[英]How do i pass an object from codebehind to populate a JQuery UI control
So I am new to using jquery and asp.net webforms together. 所以我是一起使用jquery和asp.net Webforms的新手。 The idea is that i will have a repeater, on a webform page, populated by data from a database.
我的想法是,我将在Webform页面上有一个中继器,该中继器由数据库中的数据填充。 Now i want this repeater to have an edit button which will open a jquery ui dialog with textboxes, and the data from the repeater should populate the jquery ui dialog controls.
现在,我希望此转发器具有一个编辑按钮,该按钮将打开带有文本框的jQuery UI对话框,并且来自转发器的数据应填充jQuery UI对话框控件。 How do i send data back and forth from both ends.
如何从两端来回发送数据。 Any sample code will be much appreciated.
任何示例代码将不胜感激。
Thanks you 谢谢
I have a rough plan , to achieve this. 我有一个粗略的计划,要实现这一目标。
edit
in repeater template. edit
的按钮。 edit
button. edit
按钮。 And pass the firstname
and userid
to EditUser
JS function. firstname
和userid
传递给EditUser
JS函数。 userid
that is passed to EditUser
. EditUser
userid
。 EditUser
will bring jQuery dialog, also it will show the firstname in textbox as editable field. EditUser
将显示jQuery对话框,还将在文本框中显示名字作为可编辑字段。 WebMethod
, use ajax
to post userid
stored in hidden field and newly modified firstname
to webmethod
. WebMethod
,使用ajax
将存储在隐藏字段中的userid
和新修改的firstname
到webmethod
。 Webmethod - Server code written in code behind, can be callable via ajax
. Webmethod-用后面的代码编写的服务器代码,可以通过
ajax
调用。 Help - http://www.aspsnippets.com/Articles/Calling-ASPNet-WebMethod-using-jQuery-AJAX.aspx 帮助-http: //www.aspsnippets.com/Articles/Calling-ASPNet-WebMethod-using-jQuery-AJAX.aspx
userid
and changed value, save to DB. userid
和更改的值,然后保存到DB。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.