Search code examples
asp.netupdatepanel

Asp Focus on input jumping bug


I've got a web form using asp.net. In this form I have a lot of inputs. For one of the drop downs whenever you press it, the focus jumps to the next text box.

This is in a update panel, because there is some server side work required for filtering, hiding, etc.

If the User chooses Australia from visaType_filter then it hides visaType_dd and shows visaType_tb. If they choose NZ its the other way around.

Now my question:

Is there a bug or something that makes focus jump off of a drop down when you click on it to go to the next input (or control)?

Code:

<fieldset>
    <asp:UpdatePanel ID="visaTypeUpdatePanel" runat="server">
        <ContentTemplate>
            <label>Visa Type Number</label>
            <label>
                <asp:DropDownList ID="visaType_filter" runat="server" Width="40%" OnSelectedIndexChanged="visaType_filter_SelectedIndexChanged" AutoPostBack="true"/>
                <asp:TextBox ID="visaType_tb" runat="server" Width="40%" OnTextChanged="visaType_tb_blur" AutoPostBack="true"/>
                <asp:DropDownList ID="visaType_dd" runat="server" Width="40%"/>
                <asp:Literal ID="visaType_literal" runat="server" />
            </label>
        </ContentTemplate>
    </asp:UpdatePanel>
</fieldset>
<fieldset>

Solution

  • I resolved my problem by using jQuery and Ajax in place of UpdatePanels.