473,799 Members | 2,711 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Programmatic Use of DefaultButton Doesn't Work in FireFox

I have found a situation where the DefaultButton and DefaultFocus stop
working under FireFox. I'm looking for any kind of fix or work around.

The problem seems to happen when setting a control that is part of another
control, like a templated control. The docs say to use the UniqueID in this
case. In the example below I am trying to set controls in the Login
control's LayoutTemplate.

protected void Page_Load(objec t sender, EventArgs e)
{
if (!IsPostBack)
{
Page.Form.Defau ltButton = login.FindContr ol("Login").Uni queID;
Page.Form.Defau ltFocus = login.FindContr ol("UserName"). UniqueID;
}
}

This code works fine for IE but not for FireFox. The same teqnique seems to
work fine for FireFox if the control is not part of a templated control like
just a TextBox control on the page. This may be because the UniqueID is just
the controls ID. I wonder if this fails in the MasterPage scenario.

Thanks for any help,
Tyler

--
------------------
Tyler Carver
tylercarver.com
Mar 9 '06 #1
5 1831
Hi Tyler,

Thanks for posting!

For the current issue, making a simple demo which can repro the problem is
appreciated. I understand this will take you some time to do this. However,
this really will help me to perform the testing and figure out some factors.

If you have made a demo, please don't hesitate to send it to me as zipped.
My alias is v-****@online.mic rosoft.com (remove .online). Thanks for your
understanding.

I'm looking forward your reply!

Regards,

Yuan Ren [MSFT]
Microsoft Online Support

Mar 10 '06 #2
I did some more testing and found that the DefaultButton is working, and that
it is the DefaultFocus that is not. I was implementing both at the same
time. After separating them I could see that just the DefaultFocus is the
problem for FireFox when the Unique ID is different from the controls normal
ID. This is the case in instances like a masterpage or templated control.

Tyler

--
------------------
Tyler Carver
tylercarver.com
""Yuan Ren[MSFT]"" wrote:
Hi Tyler,

Thanks for posting!

For the current issue, making a simple demo which can repro the problem is
appreciated. I understand this will take you some time to do this. However,
this really will help me to perform the testing and figure out some factors.

If you have made a demo, please don't hesitate to send it to me as zipped.
My alias is v-****@online.mic rosoft.com (remove .online). Thanks for your
understanding.

I'm looking forward your reply!

Regards,

Yuan Ren [MSFT]
Microsoft Online Support

Mar 10 '06 #3
Hi Tyler,

Thanks for your patience!

I have reproduced the current issue and reported to our dev team.
Unfortunately, there is no workaround at the current stage. I'm sorry that
the issue is not fixed due to the problem is specific for the Firefox
browser. However, our dev team has scheduled the issue in the next service
packs. I still recommend you submit a feedback to the Microsoft product
feedback. If the issue is critical, the priority will be up. I appreciate
your understanding!

You can submit the feedback via the following link:
http://lab.msdn.microsoft.com/ProductFeedback/

Your idea will be appreciated!

Regards,

Yuan Ren [MSFT]
Microsoft Online Support

Mar 14 '06 #4
I submitted a product feedback. For now the work around I am using is to
call Focus() on the control itself.

((TextBox)login .FindControl("U serName").Uniqu eID).Focus();

Thanks for verifying this issue.

Tyler
--
------------------
Tyler Carver
tylercarver.com
""Yuan Ren[MSFT]"" wrote:
Hi Tyler,

Thanks for your patience!

I have reproduced the current issue and reported to our dev team.
Unfortunately, there is no workaround at the current stage. I'm sorry that
the issue is not fixed due to the problem is specific for the Firefox
browser. However, our dev team has scheduled the issue in the next service
packs. I still recommend you submit a feedback to the Microsoft product
feedback. If the issue is critical, the priority will be up. I appreciate
your understanding!

You can submit the feedback via the following link:
http://lab.msdn.microsoft.com/ProductFeedback/

Your idea will be appreciated!

Regards,

Yuan Ren [MSFT]
Microsoft Online Support

Mar 14 '06 #5
Hi Tyler,

You are welcome:) I'll submit your workaround to the dev team. I think they
will reference it in the next version. Your idea is really appreciated!

Regards,

Yuan Ren [MSFT]
Microsoft Online Support

Mar 15 '06 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
1531
by: mablejune | last post by:
HtmlForm frm = (HtmlForm)Master.FindControl("formMain"); frm.DefaultButton = "btnSubmit"; txtCall.Focus(); Running this code produces the following error message: The DefaultButton of 'formMain' must be the ID of a control of type IButtonControl. btnSubmit is a System.Web.UI.WebControls.Button which implements
3
4916
by: dpomt | last post by:
I am facing some issues with the webforms DefaultButton functionality: #1 One text box ==> hitting enter works in IE but not in Firefox (1.5) #2 One text box and req. field validator ==> problem in IE #3 two text boxes ==> not even a postbak in Firefox. The three problems I have could be simply reproduced creating a new webform and pasting the code below in the codebehind file. TextBox bx1;
2
1722
by: Oz Kologlu | last post by:
Hi folks, IE and Asp.net 2.0 are doing some pretty bizzare things. Some of our users were getting pretty weary of IE redrawing and "flashing" what is essentially a pretty static page every time there is a postback (IE Version 6.0.2900.2180.xpsp_sp2,,,,; Doesn't happen under firefox - bless those folks). Anyway try this:
0
1626
by: Tim_Mac | last post by:
i say "bug" in quotes because i can't really blame microsoft for a feature not working in a non-microsoft browser. However, i would have preferred if they did some better browser testing! if i press return or enter inside a multiline textbox in firefox, with Page.Form.DefaultButton set, the form is submitted. validation will usually prevent an incomplete form being submitted anyway, but the user may intend to fill in optional fields,...
1
2095
by: gferreri | last post by:
Hi all, I've stumbled on an interesting problem with the way Firefox handles form submitting with the enter key. I'm putting together a page that has one form element with multiple controls with their own textbox field and submit imagebuttons. I've set up each control in an asp:Panel with their DefaultButton property set to the proper button, so when the enter key is pressed, the proper button event handler is triggered. This works...
7
2813
by: Tim_Mac | last post by:
this is a re-post of an earlier message. i'm posting it under my MSDN alias for a better chance of reply :) when you press return in a multiline textbox, you expect to insert a newline. However, if you set the Form.DefaultButton property, whatever javascript code is employed by Asp.Net to handle this functionality intercepts the key press and submits the form, when using Firefox. This is a potentially serious problem and certainly a...
4
9758
by: Tim Mackey | last post by:
hi, asp.net 2. can anyone explain why this code does not work in firefox (2.0.0.1), but does work in IE 7. if you hit enter after typing something into the textbox, it should fire the Submit button click handler, instead it fires the event for the bogus button above it. btw it doesn't matter if i set it to ClientID, UniqueID or "btnSubmit" hard-coded, they all fail. <form id="form1" runat="server"> <asp:Button ID="Button1"...
9
6775
by: Veerle | last post by:
Hi, When you use multiple asp:Buttons on one Form, then asp.net generates html submit buttons for all of them. When you put your cursor in one of the textfields of the form, the default submit button is the first submit button of the form. So if you press enter, then the form is submitted as if you pressed the first submit button of the form. But sometimes, you want the default button to be the second or third submit button of your...
1
3897
by: koraykazgan | last post by:
Hi all, I have a user control (ASCX). In that user control there is a panel, and inside that panel there is a textbox and a button. The panel has a DefaultButton property set, which is set to the button inside it. I also have a page, and on that page there are two instances of that user control (uc1 and uc2). I additionaly have an update panel on the page. In that update panel there is a label. This update panel has two async triggers...
0
9689
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9550
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10495
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10032
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9085
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7573
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5469
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
3764
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2942
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.