How do I execute get data c# code page_load() using jquery? -
converted console application c# code asp.net application added code page_load() event. gets data azure table , want display on page using simple html,
index.aspx.cs
protected void page_load(object sender, eventargs e) { // retrieve storage account connection string. cloudstorageaccount storageaccount = cloudstorageaccount.parse( cloudconfigurationmanager.getsetting("storageconnectionstring")); // create table client. cloudtableclient tableclient = storageaccount.createcloudtableclient(); // create cloudtable object represents "devicedata" table. cloudtable table = tableclient.gettablereference("devicedata"); // retrive data tablequery<customerentity> query = new tablequery<customerentity>(); foreach (customerentity entity in table.executequery(query)) { // bind data simple html table //response.write("{0}, {1}\t{2}\t{3}", entity.partitionkey, entity.rowkey, // entity.email, entity.phonenumber); } } customerentity.cs
public class customerentity : tableentity { public customerentity(string lastname, string firstname) { this.partitionkey = lastname; this.rowkey = firstname; } public customerentity() { } public string email { get; set; } public string phonenumber { get; set; } } how can display data on html page?
<!doctype html> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title></title> </head> <body> show data here </body> </html>
you can create
.aspxpage , instead ofpage_loadmethod, can use separatewebmethod, can calljqueryfind data.
refer url explains code sample , demo.
Comments
Post a Comment