I have UpdatePanel with grids, textboxes and buttons inside it. there are three buttons positioned in order : btn01, btn02, btn03...
Every time text box recdieving focus ( attempt to start typing) btn01 became default button, means if enter hit, postback starts as btn01 would be clicked. That is something that I need to prevent from happening. One of the way is to position btn03 as
first button on the page then it will become 'defaultbutton' and when enter hit postback get initiates as btn03 get clicked. I'm looking for the way to do the following :
1. Without changing physical order of the buttons set default buttoon to btn03. Can not fing property/dynamic way to do so.
2. Disable defaultbutton at all, so if during entering text into text box 'enter' key hit - nothing happening ( no postback )
gregkh
Member
1 Points
10 Posts
Default button inside UpdatePanel
Jan 03, 2013 09:38 PM|LINK
I have UpdatePanel with grids, textboxes and buttons inside it. there are three buttons positioned in order : btn01, btn02, btn03...
Every time text box recdieving focus ( attempt to start typing) btn01 became default button, means if enter hit, postback starts as btn01 would be clicked. That is something that I need to prevent from happening. One of the way is to position btn03 as first button on the page then it will become 'defaultbutton' and when enter hit postback get initiates as btn03 get clicked. I'm looking for the way to do the following :
1. Without changing physical order of the buttons set default buttoon to btn03. Can not fing property/dynamic way to do so.
2. Disable defaultbutton at all, so if during entering text into text box 'enter' key hit - nothing happening ( no postback )
Thanks
sen338
Member
498 Points
118 Posts
Re: Default button inside UpdatePanel
Jan 03, 2013 09:57 PM|LINK
Please refer the below site
http://forums.asp.net/t/1404661.aspx/1
http://stackoverflow.com/questions/4209903/asp-net-page-enter-key-causing-post-back
http://www.codeproject.com/Tips/269388/How-prevent-Textbox-postback-when-hit-enter-key-in
Change the tab order of button for setting default button.
oned_gk
All-Star
31257 Points
6389 Posts
Re: Default button inside UpdatePanel
Jan 04, 2013 01:58 AM|LINK
try like this
<asp:UpdatePanel ID="UpdatePanel1" runat="server"> <ContentTemplate> <asp:Panel ID="Panel1" runat="server" DefaultButton="Btn1"> </asp:Panel> </ContentTemplate> </asp:UpdatePanel>chetan.sarod...
All-Star
65729 Points
11133 Posts
Re: Default button inside UpdatePanel
Jan 04, 2013 12:30 PM|LINK
Refer this
http://claytonj.wordpress.com/2008/07/07/update-panel-and-default-button-fix/
http://forums.asp.net/t/1369972.aspx/1
http://forums.asp.net/t/972619.aspx/1
Senior Software Engineer,
Approva Systems Pvt Ltd, Pune, India.