Asp.net 在回发后将焦点设置在html控件上

Asp.net 在回发后将焦点设置在html控件上,asp.net,.net,webforms,postback,Asp.net,.net,Webforms,Postback,我正在使用ASP.NET中的一个表单,其中DropDownList会导致回发。我想在回发发生后将焦点设置回特定的textbox控件 我试着打电话 SetFocus(TextBox1.ID) 但我的关注点没有改变。我在Page_Load中调用了这个函数。我在调试模式下运行了该应用程序,并验证TextBox1是否为null,是否引用了正确的textbox 顺便说一下,TextBox1是一个html控件。这是标记 <input type="text" id="TextBox1" runat="

我正在使用ASP.NET中的一个表单,其中DropDownList会导致回发。我想在回发发生后将焦点设置回特定的textbox控件

我试着打电话

SetFocus(TextBox1.ID)
但我的关注点没有改变。我在Page_Load中调用了这个函数。我在调试模式下运行了该应用程序,并验证TextBox1是否为null,是否引用了正确的textbox

顺便说一下,TextBox1是一个html控件。这是标记

<input type="text" id="TextBox1" runat="server" />
这是导致回发的下拉列表

    <asp:DropDownList ID="dropdown_finance runat="server"
                         OnSelectedIndexChanged="dropdown_financer_SelectedIndexChanged"
                         AutoPostBack="true">

                         <asp:ListItem Selected="True">Father / Husband</asp:ListItem>
                         <asp:ListItem>Mother</asp:ListItem>
                         <asp:ListItem>Specify information of financer</asp:ListItem>
                     </asp:DropDownList>

我只想将焦点设置到我的文本框。如何做到这一点?

像这样将其放入回调方法中

protected void dropdown_financer_SelectedIndexChanged(object sender, EventArgs e)
{
   // other codes

   TextBox1.Focus();
}