如何在应用程序页面中绑定json值html控件 [英] how to bind json values html control in application page

查看:72
本文介绍了如何在应用程序页面中绑定json值html控件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的项目中,我们正在使用应用程序"页面开发自定义解决方案.

In my project we are developing custom solution using Application pages. 

我们需要的大多数情况从SQL获取数据.我们想获取json值并将这些值绑定到应用程序页面的html控件中.

most of the scenario we needs  fetch the data from SQL. we would like to get the json values and bind those values in the html control in application page. 

为避免性能问题...我们计划像这样...

to avoid performance issue... we planned like this...

如何实现这一目标...

how to achieve this... please help me. 

推荐答案

我们可以创建一种从SQL获取数据的方法,然后添加 WebMethod 为此方法,然后使用jQuery Ajax调用该方法并将数据绑定到HTML表.

We can create a method to get the data from SQL, then add WebMethod for this method, and then call the method using jQuery Ajax and bind the data to a HTML table.

[WebMethod]
[ScriptMethod(ResponseFormat = ResponseFormat.Json)]
public static string GetServerData()
{
    return "Json Data";
}

以下文章供您参考:

使用JQuery的SharePoint中的WebMethods

http://www.thesharepointguide.com/webmethods-in-sharepoint-using-jquery/

使用jQuery将JSON数据绑定到HTML表

https://www.aspsnippets.com/Articles /Bind-JSON-data-to-HTML-Table-using-jQuery.aspx

如果要在SharePoint中使用来自SQL的外部数据,建议您使用Business Connectivity Services(BCS)来实现.使用SharePoint Designer创建外部内容类型并创建外部列表(无代码).

If you want to use External data from SQL in SharePoint, I suggest you use Business Connectivity Services (BCS) to achieve it. Create a external content type and create a external list using SharePoint designer(no code).

http://www.c- sharpcorner.com/UploadFile/anavijai/create-external-content-type-using-sharepoint-designer-2013/

最好的问候,

丹尼斯


这篇关于如何在应用程序页面中绑定json值html控件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆