I to face this problem in program. but i'm using master page. when i open another webform and enter the hit button it executes the master page button , but it supposed to execute current webform button
No Need Of this much of stuff.Just u can do in the following way
//the button which you want as default button define it in defaultbutton
<
form id="form1"
runat="server"
defaultbutton=
"btn_Submit">
Regards,
B.ShivaKarthik
Developer
Hyderabad,India
-------------------------------------------------
Don't Forget to Mark as Answer for the post that helped you.
-------------------------------------------------
ezhillmaran
Participant
1387 Points
298 Posts
Re: ASP.NET 2.0 - Enter Key - Default Submit Button
Feb 18, 2008 03:31 PM|LINK
I to face this problem in program. but i'm using master page. when i open another webform and enter the hit button it executes the master page button , but it supposed to execute current webform button
Maran.
gnuts4lunch
Member
42 Points
99 Posts
Re: ASP.NET 2.0 - Enter Key - Default Submit Button
Mar 26, 2008 09:05 AM|LINK
i had the same problem and tried the code you suggested...i got the error below;
Error 1 The name 'Login1' does not exist in the current context C:\inetpub\wwwroot\wbsa\index.aspx.cs 18 35 http://localhost/wbsa/
gnuts4lunch
Member
42 Points
99 Posts
Re: ASP.NET 2.0 - Enter Key - Default Submit Button
Mar 26, 2008 11:09 AM|LINK
Hi Parcol,
Can you show me some code on your panel workaround?
I tried your suggestions and it gave me some errors.
Thanks
zubinjoshi
Member
219 Points
76 Posts
Re: ASP.NET 2.0 - Enter Key - Default Submit Button
Apr 24, 2008 07:27 AM|LINK
how this can be solved in .net 1.1
suppose there are two frame one for new login and another for existing login ........ with 2 textboxes and one button in each frame...
when user mouse is in the perticular textbox the corresponding button should fire ,,, as that we have in .net 2.0 through defaultbutton in div
how can be done in .net 1.1
ezhillmaran
Participant
1387 Points
298 Posts
Re: ASP.NET 2.0 - Enter Key - Default Submit Button
Apr 24, 2008 07:38 AM|LINK
Set default button as new login for frame1 and existing login for frame 2
Maran.
thirumaran007
Contributor
3064 Points
624 Posts
Re: ASP.NET 2.0 - Enter Key - Default Submit Button
Apr 24, 2008 10:17 AM|LINK
Hi Friend,
Just use access key property to do that
Thirumaran
Please remember to click "Mark as Answer" on this post if it helped you
ShivaKarthik
Participant
1641 Points
270 Posts
Re: ASP.NET 2.0 - Enter Key - Default Submit Button
Apr 28, 2008 12:02 PM|LINK
No Need Of this much of stuff.Just u can do in the following way
//the button which you want as default button define it in defaultbutton
<
form id="form1" runat="server" defaultbutton= "btn_Submit">B.ShivaKarthik
Developer
Hyderabad,India
-------------------------------------------------
Don't Forget to Mark as Answer for the post that helped you.
-------------------------------------------------
Zarna
Member
2 Points
1 Post
Re: ASP.NET 2.0 - Enter Key - Default Submit Button
May 13, 2008 12:03 PM|LINK
Page.Form.DefaultButton = Me.FindControl("Button1").UniqueID
it works successfully .
Write it on Page_Load Event
stapes
Member
119 Points
112 Posts
Re: ASP.NET 2.0 - Enter Key - Default Submit Button
May 14, 2008 01:41 PM|LINK
Method did not work for me. Completely ignored my default button and continued to process another button when enter is pressed.rmdw
Participant
797 Points
1085 Posts
Re: ASP.NET 2.0 - Enter Key - Default Submit Button
May 14, 2008 04:23 PM|LINK
The ideas presented already are good ones. Here's another, more extensive example that definitely works:
<div id="1f2i" class="ArwC7c ckChnd"> <tr><asp:Panel ID="newsletterPanel" CssClass="newsletter" runat="server">
<table style="background-color:#B9C8FF; border-style:none; width:100%">
<td class="smallText" colspan="2">
Sign up for our newsletter:
</td>
</tr>
<tr>
<td class="smallText">Email:</td>
<td class="rightTextBox">
<asp:TextBox ID="textBoxSubscribeEmail" CssClass="smallTextBox" runat="server" ValidationGroup="Newsletter" />
</td>
</tr>
<tr>
<td class="smallText">Name:</td>
<td class="rightTextBox"><asp
</tr>
<tr>
<td align="right" colspan="2">
<asp:Button ID="buttonSubscribe" CssClass="smallTextButton" runat="server" Text="Subscribe" OnClick="buttonSubscribe_Click" ValidationGroup="Newsletter" />
<br />
<div class="smallText" style="text-align:left; padding-top:5px">
<asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server"
/>
<asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server"
/>
<asp:RegularExpressionValidator ID="RegularExpressionValidator1
/>
</div>
</td>
</tr>
</table>
</asp:Panel>
<cc1:RoundedCornersExtender ID="RoundedCornersExtender1" runat="server" TargetControlID="newsletterPane
</ContentTemplate>
</asp:UpdatePanel>
// Pressed when the user wants to subscribe to the PP newsletter
protected void buttonSubscribe_Click(object sender, EventArgs e)
{
string retMsg = DBAccess.AddSubscriber(textBoxS
ShowMessage(retMsg);
textBoxSubscribeEmail.Text = "";
textBoxSubscribeName.Text = "";
}
protected void Page_Load(object sender, EventArgs e)
{
// Make the Newsletter Subscribe button the default button
if (!IsPostBack)
{
Page.Form.DefaultButton = buttonSubscribe.UniqueID;
}
}</div>
Vancouver, BC
Technical Blog
Pocket Pollster