By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,454 Members | 3,209 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,454 IT Pros & Developers. It's quick & easy.

Login control can't fire the button event by hitting enter

P: n/a
Hi, all

The scenario is like this:

I have a master page, contains two user controls, one is a search
control, another is a login control.

The server-side <form> is in the master page, that's of course.

It seems the search control is rendered first, when I stay in the
search textbox, input something, and click enter, it will fire the
search button event. That's correct.

When I stay in the login textbox, input the user name and password, and
click enter, it will always fire the search button event!

I can only use mouse to click to button to fire the login event.

How can I solve that?
Thanks
----------------------------------------
Sowen
..NET Image Components
http://www.ImageComponent.net

Apr 19 '06 #1
Share this Question
Share on Google+
4 Replies


P: n/a
BTW, the search user control contains just a textbox and an ImageButton
the login user control is using the ASP:LoginView web control

Apr 19 '06 #2

P: n/a
In a form the enter key submits the form (thus across the whole form there
is only a single submit action). In your case the submit is firing your
search event. You may have to do some custom scripting on the client side.
Maybe add a onkeypress function to your login text box to capture the enter
key. When you do that you can change how you submit your form so you can
determine in the code that it was triggered by the login text box.

<so*********@gmail.com> wrote in message
news:11*********************@z34g2000cwc.googlegro ups.com...
Hi, all

The scenario is like this:

I have a master page, contains two user controls, one is a search
control, another is a login control.

The server-side <form> is in the master page, that's of course.

It seems the search control is rendered first, when I stay in the
search textbox, input something, and click enter, it will fire the
search button event. That's correct.

When I stay in the login textbox, input the user name and password, and
click enter, it will always fire the search button event!

I can only use mouse to click to button to fire the login event.

How can I solve that?
Thanks
----------------------------------------
Sowen
.NET Image Components
http://www.ImageComponent.net

Apr 19 '06 #3

P: n/a
ha, that's what I want to do too.

then I can't use <asp:loginview> control directly, I will have to
create my own login control.

frankly, it makes me a little frustrating, since apparently this is a
bug of this control or a bug about MasterPage, it seems to me that
microsoft never considered a situation like that. :(

Apr 19 '06 #4

P: n/a
CMM
Not sure about this... but won't wrapping the login view in a Panel and
setting default buttons... and possibly a combination of using the server
side Control.Focus alleviate this?
See here for more info...
http://weblogs.asp.net/scottgu/archi...04/421647.aspx

P.S. I hope the info above helps... but, I wouldn't be surprised if this was
indeed a bug. There's all sorts of weird "gotchas" with Master Pages (come
on... just allow us to *design* a UserControl that can act as Panel guys!
that would make Master Pages obsolete.... sheesh it's obvious... who's the
visionary at Microsoft?).

--
-C. Moya
www.cmoya.com
<so*********@gmail.com> wrote in message
news:11**********************@e56g2000cwe.googlegr oups.com...
ha, that's what I want to do too.

then I can't use <asp:loginview> control directly, I will have to
create my own login control.

frankly, it makes me a little frustrating, since apparently this is a
bug of this control or a bug about MasterPage, it seems to me that
microsoft never considered a situation like that. :(

Apr 20 '06 #5

This discussion thread is closed

Replies have been disabled for this discussion.