Click here to Skip to main content
14,690,505 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
I have textbox control with autopostback = "true" in update panel and there is save button with access key of "Alt + s" when i change something into textbox and without losing focus if user has pressed "Alt + s" than need to call first textchange event of textbox and then should fire save click event as there is some calculation on textchange event.In this situation first it fires save click event and than it calls textchange event.

Is there any good approach to resolve issue either client side or server side?

What I have tried:

<asp:UpdatePanel ID="UpdatePanel1" runat="server">
 <ContentTemplate>

<asp:TextBox ID="Txt_Val" runat="server" AutoPostBack="True"                                OnTextChanged="Txt_Val_TextChanged"></asp:TextBox>

<asp:Button ID="Btn_Save"  runat="server" OnClick="Btn_Save_Click" Text="Save" AccessKey="S" ValidationGroup="S"/>

</ContentTemplate>
            </asp:UpdatePanel>



protected void Btn_Save_Click(object sender, EventArgs e)
   {
        //Save data into database
   }

protected void Txt_Val_TextChanged(object sender, EventArgs e)
    {
           // Some calculation
    }
Posted
Updated 11-Jun-19 21:01pm
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900