Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Setting the DefaultButton prop of a Panel under a Mountain of Templates

Reply
Thread Tools

Setting the DefaultButton prop of a Panel under a Mountain of Templates

 
 
Steve Prescott
Guest
Posts: n/a
 
      06-19-2008
Hi Gang,

I am trying to set the DefaultButton prop of a Panel so that when the user
has entered his login credentials and strikes the < Enter > key, he will be
loggin in. The Button (btnLogin) is buried under this hierarchy of parent
controls: Panel > asp.LoginView > AnonymousTemplate > asp.Login >
LayoutTemplate > btnLogin. I can't figure it out. Thanks for any ideas.

Steve

 
Reply With Quote
 
 
 
 
Munna
Guest
Posts: n/a
 
      06-20-2008
Hi,

I am not sure wheither it will work or not... but still you can give a
try...

use find control to get the reference of the button from login control

Button btn = (Button) Login1.FindControl("LoginButton");
this.form1.DefaultButton = btn.ID;

Best of luck

Munna

www.munna.shatkotha.com
www.munna.shatkotha.com/blog
www.shatkotha.com
 
Reply With Quote
 
 
 
 
Uriah Piddle
Guest
Posts: n/a
 
      06-23-2008
Hu Munna,

I wanted to thank you for your suggestion. I tried that before the post and
it did not work. I wanted to return to the issue right after your post but
got caught up in another thing. If I find that solution, I'll post it.
Thanks.

Steve

"Munna" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Hi,
>
> I am not sure wheither it will work or not... but still you can give a
> try...
>
> use find control to get the reference of the button from login control
>
> Button btn = (Button) Login1.FindControl("LoginButton");
> this.form1.DefaultButton = btn.ID;
>
> Best of luck
>
> Munna
>
> www.munna.shatkotha.com
> www.munna.shatkotha.com/blog
> www.shatkotha.com



 
Reply With Quote
 
Steve Prescott
Guest
Posts: n/a
 
      06-23-2008
I figured it out.

Problem: Because you want users to login with the <Enter> instead of
clicking a button, you want to make the login button of your login control
the default button of the panel that contains it but panel cannot see the
button because it is contained by a hierarchy of templates.

Solution: nest a panel directly inside the Anonymous Template of your
LoginView control. Make sure your Login control is contained inside this
template. Set the DefaultButton prop of that panel to this: <Name of Login
control><$><Name of Button>. So if your login control is named 'Login1' and
the button is 'btnLogin' then set the DefaultButon prop to
'Login1$btnLogin'.

 
Reply With Quote
 
 
 
Reply

Thread Tools

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
Setting the Form.DefaultButton from CodeBehind Alex Maghen ASP .Net 1 02-11-2008 07:23 AM
Setting the Form DefaultButton to a wizard Step Button (2.0) John Mott ASP .Net 3 12-19-2006 10:49 AM
how to Specializations of function Templates or Overloading Function templates with Templates ? recover C++ 2 07-25-2006 02:55 AM
How do I use the DefaultButton setting when using Master Pages? dotnetjose@gmail.com ASP .Net 2 03-19-2006 08:15 AM
Templates templates templates JKop C++ 3 07-21-2004 11:44 AM



Advertisments