如何使用jquery执行get data c#code page_load()?
已将控制台应用程序c#code转换为asp.net应用程序,并将代码添加到Page#Load()事件中。它从Azure表中获取数据,并希望使用如何使用jquery执行get data c#code page_load()?,c#,jquery,asp.net,azure,C#,Jquery,Asp.net,Azure,已将控制台应用程序c#code转换为asp.net应用程序,并将代码添加到Page#Load()事件中。它从Azure表中获取数据,并希望使用简单html在页面上显示数据 Index.aspx.cs protected void Page_Load(object sender, EventArgs e) { // Retrieve the storage account from the connection string. CloudStorageAcc
简单html在页面上显示数据
Index.aspx.cs
protected void Page_Load(object sender, EventArgs e)
{
// Retrieve the storage account from the connection string.
CloudStorageAccount storageAccount = CloudStorageAccount.Parse(
CloudConfigurationManager.GetSetting("StorageConnectionString"));
// Create the table client.
CloudTableClient tableClient = storageAccount.CreateCloudTableClient();
// Create the CloudTable object that represents the "DeviceData" table.
CloudTable table = tableClient.GetTableReference("DeviceData");
// retrive data
TableQuery<CustomerEntity> query = new TableQuery<CustomerEntity>();
foreach (CustomerEntity entity in table.ExecuteQuery(query))
{
// bind data to simple html table
//Response.Write("{0}, {1}\t{2}\t{3}", entity.PartitionKey, entity.RowKey,
// entity.Email, entity.PhoneNumber);
}
}
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; }
}
如何在html页面上显示数据
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
</head>
<body>
Show Data here
</body>
</html>
在此处显示数据
您可以创建.aspx
页面,而不是页面加载
方法,您可以
使用单独的WebMethod
,可以从jquery
调用来查找
数据
请参阅此URL
,它通过code
示例和demo
很好地解释了这一点
如果一切都发生在页面加载的服务器端,jquery与此有什么关系?只需将数据绑定到DataGrid/DataList/Repeater,就完成了。如果需要教程,只需将所选控件拖到页面上,然后按F1键即可。