C# 使用JQuery设置ViewState
我有一个GridView的CustomWebUserControl,要在使用ViewState的项目周围移动,现在我需要在单击行时移动SelectedIndex,过程如下:C# 使用JQuery设置ViewState,c#,jquery,asp.net,webforms,C#,Jquery,Asp.net,Webforms,我有一个GridView的CustomWebUserControl,要在使用ViewState的项目周围移动,现在我需要在单击行时移动SelectedIndex,过程如下: 单击所需的行 在currentItemTextBox.Text中设置rowIndex的值 该值将使用TextChanged事件输入ViewState 我将调用GridView的数据绑定,以使用此ViewState选择当前行的内部方法 $(文档).ready(函数(){ $(“#tr”)。单击(函数(){ var ind=$
$(文档).ready(函数(){
$(“#tr”)。单击(函数(){
var ind=$(this.index();
$(“#”)val(ind);
});
});
*当脚本设置该值时,不会调用TextChanged事件
我希望您能理解我的场景。请在此处输入代码
谢谢 尝试在文本框中添加AutoPostBack=“True”。这将调用ContextChanged事件
<asp:TextBox ID="currentIndexTexBox" runat="server" OnTextChanged="CurrentIndexTextBoxOnTextChanged()" AutoPostBack="True"></asp:TextBox>
<asp:TextBox ID="currentIndexTexBox" runat="server" OnTextChanged="CurrentIndexTextBoxOnTextChanged()" AutoPostBack="True"></asp:TextBox>