Re: Form.DefaultButton stopped working in firefox
- From: "Tim Mackey" <tim.mackey@xxxxxxxxxxxxxxxx>
- Date: Mon, 19 Feb 2007 12:46:05 -0000
hi guys,
many thanks for the detailed replies.
i was a bit thrown because i read in the HtmlForm.DefaultButton property in the docs that "If you are using master pages in your application and you are setting the DefaultButton property from a content page, use the UniqueID property of the IButtonControl button", and assumed this would also work for normal pages. i re-read it now and it does clearly say to use the ID property first, so my bad, but it is slightly annoying that the behaviour changes for master pages or normal pages, particularly because we can't use the declarative syntax for child pages since the form tag is in the master page.
thanks anyway, i can live with it!
tim
"Steven Cheng[MSFT]" <stcheng@xxxxxxxxxxxxxxxxxxxx> wrote in message news:K$kOPj9UHHA.300@xxxxxxxxxxxxxxxxxxxxxxxxx
Thanks for Jason's informative input.
Hi Tim,
As Jason has suggested, for the Form.DefaultButton and Form.DefaultFocus
setting code, there are two places you need change:
1. You need to put the code that configure the HtmlForm.DefaultFocus and
DefaultButton in every reques(no only the initial request)
2. You should use "ID" property rather than "ClientID" or "uniqueID".
Actually, for server-side processing, generally we only need to use
Control's ID(the other twos are mostly used for client-side processing).
Here is the modified codebehind code snippet I've used correctly on my
side(win XP sp2, ie7 and ff2.0):
=====================
public partial class nav_NavButtonPage : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
Page.Form.DefaultButton = btnSelect.ID;
Page.Form.DefaultFocus = txtID.ID;
}
protected void Button1_Click(object sender, EventArgs e)
{
Response.Write("BOGUS BUTTON");
}
protected void btnSelect_Click(object sender, EventArgs e)
{
Response.Write("SUBMIT BUTTON");
}
}
===========================
Hope this also helps.
Sincerely,
Steven Cheng
Microsoft MSDN Online Support Lead
==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.
Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
.
- Follow-Ups:
- Re: Form.DefaultButton stopped working in firefox
- From: Steven Cheng[MSFT]
- Re: Form.DefaultButton stopped working in firefox
- References:
- Form.DefaultButton stopped working in firefox
- From: Tim Mackey
- RE: Form.DefaultButton stopped working in firefox
- From: Jason Vermillion
- RE: Form.DefaultButton stopped working in firefox
- From: Steven Cheng[MSFT]
- Form.DefaultButton stopped working in firefox
- Prev by Date: Re: Drop down list problem on W2000 Server
- Next by Date: Re: Download file downloads the source page instead
- Previous by thread: RE: Form.DefaultButton stopped working in firefox
- Next by thread: Re: Form.DefaultButton stopped working in firefox
- Index(es):
Relevant Pages
|