473,659 Members | 3,592 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Default Button: RegisterHiddenF ield

I am having a brain fart today....

How do you set a default button within a User Control? I am using
"Page.RegisterH iddenField("__E VENTTARGET", "btnSubmit" )" but it does not
seem to be working for me.

I have another User Control which uses this technique and works. Can't
think of what I am missing?

--
Thanx in Advance,

atr2000
Nov 19 '05 #1
3 1571
Check the name of the Button through the Html Source (in IE)
When you register a control on your page, it renames your controls with
[ControlTagName]_[IDYOUSET]
you can pick this up by viewing source from IE, and viewing the now changed
ID of your button 'btnsubmit'

to fix this, just change your javascript with the new id
"Page.RegisterH iddenField("__E VENTTARGET", "[TAGNAME]_btnSubmit")"
Bearing in mind for this solution, you'll need to give the control the same
tagname wherever you use it - unless the javascript is in the page and not
the control

HTH
"John Smith" <no*******@addr ess.com> wrote in message
news:ux******** ******@tk2msftn gp13.phx.gbl...
I am having a brain fart today....

How do you set a default button within a User Control? I am using
"Page.RegisterH iddenField("__E VENTTARGET", "btnSubmit" )" but it does not
seem to be working for me.

I have another User Control which uses this technique and works. Can't
think of what I am missing?

--
Thanx in Advance,

atr2000

Nov 19 '05 #2
John Smith <no*******@addr ess.com> ha scritto:
I am having a brain fart today....

How do you set a default button within a User Control? I am using
"Page.RegisterH iddenField("__E VENTTARGET", "btnSubmit" )" but it does
not seem to be working for me.

I have another User Control which uses this technique and works.
Can't think of what I am missing?


Page.RegisterHi ddenField("__EV ENTTARGET", btnSubmit.Uniqu eID)

--
AZ [Microsoft - .NET MVP]
Mia Home page: http://ciclismo.sitiasp.it
Asp.Net community: http://www.aspitalia.com
Il mio blog: http://blogs.aspitalia.com/az
Nov 19 '05 #3
That worked thanx a lot

--
Thanx in Advance,

atr2000
"Andrea Zani" <an****@aspital ia.com> wrote in message
news:GM******** ************@tw ister1.libero.i t...
John Smith <no*******@addr ess.com> ha scritto:
I am having a brain fart today....

How do you set a default button within a User Control? I am using
"Page.RegisterH iddenField("__E VENTTARGET", "btnSubmit" )" but it does
not seem to be working for me.

I have another User Control which uses this technique and works.
Can't think of what I am missing?


Page.RegisterHi ddenField("__EV ENTTARGET", btnSubmit.Uniqu eID)

--
AZ [Microsoft - .NET MVP]
Mia Home page: http://ciclismo.sitiasp.it
Asp.Net community: http://www.aspitalia.com
Il mio blog: http://blogs.aspitalia.com/az

Nov 19 '05 #4

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

Similar topics

3
3234
by: KJ | last post by:
I have seen examples on how to set the default button on a ASPX page with asp server controls Sub Page_Load() Page.RegisterHiddenField("__EVENTTARGET", "btnSearch") End Sub But that does not work if your default button is inside a custom
4
1381
by: Anton ml. Vaheie | last post by:
Hi, Can somebody tell me how to convince explorer that my "button" will be pressed when I press Enter - in other words that it will be default button. Just like in windows forms. I use web form button. Thanks, Anton
3
1121
by: Richard Roche | last post by:
What are the ways to set default (activiated on enter) status for buttons? i've tried: TabIndex and Page.RegisterHiddenField("__EVENTTARGET", "cmdWhatever") but the first button seems to be default always. I must be missing something.
3
1449
by: Dan Brussee | last post by:
I have a form with 2 or more buttons. How do I control which one will fire when I press the Enter key? In traditional ASP, I could create 2 or more forms, each with their own Submit buttons. Since there is only one form, how do I control which of the submit buttons will fire?
4
1423
by: tshad | last post by:
I have 3 objects on my page (textbox,button and linkbutton) When I put something in my textbox and hit "enter", the page gets posted, but nothing happens. I don't go to either of the functions that both buttons are set up for. If I push the buttons directly, it works fine. The Button is the first button on the page and the one I want to be default. Is there something I have to do to make it a default button?
2
1294
by: jonefer | last post by:
This is quite serious - for a beginner... No property setting for a default button? I just want a button on a search page to automatically be pressed when I hit the return/enter key. Somehow I did it with one of my 2 buttons, (but I don't know how) one of the buttons (cmdClear) decided on its own to be the default button - instead of the cmdSearchMember button - so much so that even after searching and finding 2 other solutions: 1)...
4
1475
by: tshad | last post by:
I have a page with 2 buttons and was told I could get my choice of button to act as the default button but add the following code to the my Page_Load: Page.RegisterHiddenField("__EVENTTARGET", "btnSearch") I have the following code and page: **************************************************** <script runat="server"> Sub Page_Load(s as Object, e as EventArgs)
1
2111
by: andyrich_1 | last post by:
I have a simple form that has two submit buttons on it. The problem I have is that I want one button to be the default button when the user is filling out one section of the form and another button to be the default when filling out a different art of the form. I can't seem to find a way of stopping the first button on the form begin selected. I know there is a way to do this in ASP.NET 2.0 but I can't seem to find one in ASP.NET 1.0
2
9829
by: AlecL | last post by:
Hi All, I have added a user control onto an aspx page and want to make the submit button of that user control the default button when the panel in which the user control is located is visible. I have used the code: Page.RegisterHiddenField("__EVENTTARGET", "Login.btnSubmit") in the Page Load event but this does not make the submit button default(enter) button. Any ideas on how can I do this. I have also tried using just the name of...
0
8428
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
8337
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
8851
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
8748
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
6181
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
5650
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4335
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2754
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1978
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.