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
IButtonControl.
Is this a bug? 9 1506
Try assigning DefaultButton to the ClientID of the button.
Something like this:
HtmlForm frm = (HtmlForm)Master.FindControl("formMain");
IButtonControlbtn = (IButtonControl)Master.FindControl("btnSubmit");
frm.DefaultButton = btn.ClientID;
txtCall.Focus();
Joshua Flanagan http://flimflan.com/blog
On Wed, 14 Dec 2005 18:04:53 -0600, Joshua Flanagan <jo**@msnews.com>
wrote:
Thank you Joshua. I'll do that. Try assigning DefaultButton to the ClientID of the button.
Something like this: HtmlForm frm = (HtmlForm)Master.FindControl("formMain"); IButtonControlbtn = (IButtonControl)Master.FindControl("btnSubmit"); frm.DefaultButton = btn.ClientID; txtCall.Focus();
Joshua Flanagan http://flimflan.com/blog
On Wed, 14 Dec 2005 18:04:53 -0600, Joshua Flanagan <jo**@msnews.com>
wrote:
Joshua,
Doesn't work. I think it's a bug. I'll report it... Try assigning DefaultButton to the ClientID of the button.
Something like this: HtmlForm frm = (HtmlForm)Master.FindControl("formMain"); IButtonControlbtn = (IButtonControl)Master.FindControl("btnSubmit"); frm.DefaultButton = btn.ClientID; txtCall.Focus();
Joshua Flanagan http://flimflan.com/blog
On Wed, 14 Dec 2005 18:04:53 -0600, Joshua Flanagan <jo**@msnews.com>
wrote:
It's a bug. Here's the workaround...
HtmlForm frm = (HtmlForm)Master.FindControl("formMain");
Button btn = (Button)this.btnSubmit;
frm.DefaultButton = btn.UniqueID; Try assigning DefaultButton to the ClientID of the button.
Something like this: HtmlForm frm = (HtmlForm)Master.FindControl("formMain"); IButtonControlbtn = (IButtonControl)Master.FindControl("btnSubmit"); frm.DefaultButton = btn.ClientID; txtCall.Focus();
Joshua Flanagan http://flimflan.com/blog
Sorry, UniqueID is what I meant (didn't have the docs in front of me).
That is the correct behavior - it is not a bug.
On Thu, 15 Dec 2005 11:19:30 -0600, Joshua Flanagan <jo**@msnews.com>
wrote: Sorry, UniqueID is what I meant (didn't have the docs in front of me). That is the correct behavior - it is not a bug.
On Thu, 15 Dec 2005 11:19:30 -0600, Joshua Flanagan <jo**@msnews.com>
wrote:
When it was reported a year ago it was a bug. They simply rewrote the
help files to cover it. Check the bug history on it. Sorry, UniqueID is what I meant (didn't have the docs in front of me). That is the correct behavior - it is not a bug. This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Jeff |
last post by:
We have 3 environments, Dev, Qa, Prod. I'm working on an application
that has a search page. On the search page is 3 panels. One panel is
the advanced search, another a normal search and the...
|
by: Evert Wiesenekker |
last post by:
I have a mail page with a send button containing three validators (2
required val. and 1 expression val.). The masterpage contains 3
imagebuttons.
Now when I press enter the first time the...
|
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...
|
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. ...
|
by: John Mott |
last post by:
Hi All,
I'm trying to set the defaultbutton for a form to a button contained in a
step template for a wizard control. This is the code in PreRender:
switch (myWizard.ActiveStep.StepType) {...
|
by: =?Utf-8?B?QmlnSm9obg==?= |
last post by:
We can set the default button and focus field in ASP.Net 2.0 on the Form tag.
My form tag is in the Master page, but the controls are in containers.
I read through a few articles which did not...
|
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...
|
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...
|
by: =?Utf-8?B?QWxleCBNYWdoZW4=?= |
last post by:
Hi. I have a MasterPage but on each particular page that uses it, I need to
be able to set the DefaultButton for the Form for that page. From the .cs
file of my ASPX page, I have tried:
-...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM).
In this month's session, we are pleased to welcome back...
|
by: Vimpel783 |
last post by:
Hello!
Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
|
by: jfyes |
last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
|
by: ArrayDB |
last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
|
by: PapaRatzi |
last post by:
Hello,
I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
|
by: CloudSolutions |
last post by:
Introduction:
For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
|
by: Defcon1945 |
last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
|
by: Faith0G |
last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
| |