PC Review


Reply
Thread Tools Rating: Thread Rating: 1 votes, 1.00 average.

Default Button: RegisterHiddenField

 
 
John Smith
Guest
Posts: n/a
 
      16th Aug 2005
I am having a brain fart today....

How do you set a default button within a User Control? I am using
"Page.RegisterHiddenField("__EVENTTARGET", "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


 
Reply With Quote
 
 
 
 
Grant Merwitz
Guest
Posts: n/a
 
      16th Aug 2005
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.RegisterHiddenField("__EVENTTARGET", "[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" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
>I am having a brain fart today....
>
> How do you set a default button within a User Control? I am using
> "Page.RegisterHiddenField("__EVENTTARGET", "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
>
>



 
Reply With Quote
 
Andrea Zani
Guest
Posts: n/a
 
      16th Aug 2005
John Smith <(E-Mail Removed)> ha scritto:
> I am having a brain fart today....
>
> How do you set a default button within a User Control? I am using
> "Page.RegisterHiddenField("__EVENTTARGET", "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.RegisterHiddenField("__EVENTTARGET", btnSubmit.UniqueID)

--
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


 
Reply With Quote
 
John Smith
Guest
Posts: n/a
 
      16th Aug 2005
That worked thanx a lot

--
Thanx in Advance,

atr2000
"Andrea Zani" <(E-Mail Removed)> wrote in message
news:GMnMe.19198$(E-Mail Removed)...
> John Smith <(E-Mail Removed)> ha scritto:
> > I am having a brain fart today....
> >
> > How do you set a default button within a User Control? I am using
> > "Page.RegisterHiddenField("__EVENTTARGET", "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.RegisterHiddenField("__EVENTTARGET", btnSubmit.UniqueID)
>
> --
> 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
>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
RegisterHiddenField question. ashish Microsoft ASP .NET 2 11th Mar 2005 04:39 PM
RegisterHiddenField harry Microsoft ASP .NET 1 23rd Mar 2004 06:09 PM
registerhiddenfield question Ashish Microsoft ASP .NET 6 10th Mar 2004 10:42 PM
Re-RegisterHiddenField Cliff Harris Microsoft ASP .NET 0 5th Nov 2003 04:33 PM
RegisterHiddenField and trace Kevin Spencer Microsoft ASP .NET 2 22nd Oct 2003 02:39 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 03:54 AM.