Solved

ASP.NET Default Button

Posted on 2007-12-03
3
190 Views
Last Modified: 2013-11-26
I have a home.aspx page that loads controls based on Request.Params

The Case statement in the Master Page is

 Select Case CStr(Request.Params("page"))
            Case "home" --------------------
A bunch of case statements
---------------------------

Case Else
                Session("info") = " Home Page"
                Dim uc As UserControl = CType(LoadControl("includes/login.ascx"), UserControl)
                uc.ID = "uc99"
                ContentPlaceHolder1.Controls.Add(uc)
End Select

includes/login.ascx has this button
<asp:ImageButton ID="ImageButton1" src="images/btnLogin.jpg" runat="server" TabIndex="1"  />

How do I make that the default if someone just hits the enter key?

Open in new window

0
Comment
Question by:lrbrister
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 13

Accepted Solution

by:
newyuppie earned 500 total points
ID: 20400890
in the load event of the page put the following in the first line:

Page.Form.DefaultButton = ImageButton1.UniqueID

Hope it helps
NY
0
 

Author Closing Comment

by:lrbrister
ID: 31412521
Excellent...to the point...and right on time.  With a code example.  Some of the experts could take a lesson from this answer.  Great job newyuppie.
0
 
LVL 13

Expert Comment

by:newyuppie
ID: 20401000
thank you for the kind comments. im glad it helped you. cheers
NY
0

Featured Post

[Live Webinar] The Cloud Skills Gap

As Cloud technologies come of age, business leaders grapple with the impact it has on their team's skills and the gap associated with the use of a cloud platform.

Join experts from 451 Research and Concerto Cloud Services on July 27th where we will examine fact and fiction.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In my previous two articles we discussed Binary Serialization (http://www.experts-exchange.com/A_4362.html) and XML Serialization (http://www.experts-exchange.com/A_4425.html). In this article we will try to know more about SOAP (Simple Object Acces…
Creating an analog clock UserControl seems fairly straight forward.  It is, after all, essentially just a circle with several lines in it!  Two common approaches for rendering an analog clock typically involve either manually calculating points with…
In this video, viewers are given an introduction to using the Windows 10 Snipping Tool, how to quickly locate it when it's needed and also how make it always available with a single click of a mouse button, by pinning it to the Desktop Task Bar. Int…
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…

632 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question