Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/84.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
C# 使用JQuery设置ViewState_C#_Jquery_Asp.net_Webforms - Fatal编程技术网

C# 使用JQuery设置ViewState

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=$

我有一个GridView的CustomWebUserControl,要在使用ViewState的项目周围移动,现在我需要在单击行时移动SelectedIndex,过程如下:

  • 单击所需的行
  • 在currentItemTextBox.Text中设置rowIndex的值
  • 该值将使用TextChanged事件输入ViewState
  • 我将调用GridView的数据绑定,以使用此ViewState选择当前行的内部方法
  • 
    $(文档).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>