Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/219.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何使用jquery执行get data c#code page_load()?_C#_Jquery_Asp.net_Azure - Fatal编程技术网

如何使用jquery执行get data c#code page_load()?

如何使用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

已将控制台应用程序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.
        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键即可。