473,385 Members | 1,588 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Master Page Button and Detail Page Button

I have a website (ASPNET2) where the master page has a button in it and my login page, which is a detail page of the master page,
also has a button (a login button).

Everything works fine if I enter my user ID and password and click the Login button. But if I hit the return key instead the master
page button gets invoked instead of the Login button.

Is there a way of ensuring the Login button on the detail page gets the "default" return key event rather than the master page?
Other than disabling the master key button, which I know will work.

- Mark
Jan 30 '06 #1
4 2240
Hello,

To get around this problem, you may use a HTML INPUT button instead of
asp:Button control on the msater page. for example:

<input id="Button1" style="width: 107px; height: 49px" type="button"
value="button" runat="server" onserverclick="Button1_ServerClick" />

Asp:Button control will be rendered as Input Submit control in client
browser. When you press enter key in a textbox, the first Input Submit
control in a web page will be invoked.

Hope this help,

Luke

Jan 31 '06 #2
Luke,

I didn't mention that the button on the master page is an ImageButton control. Is there a simple way to force the ImageButton
control to not be rendered as a submit button?

- Mark
Jan 31 '06 #3
Hello,

To replace a ImageButton:

<img id="img1" src="p1.jpg" style="width: 97px; cursor: hand;"
runat="server" onclick="__doPostBack('img1','')" />

Notice there is no event handler function in the code behind now, we need
to handle the click event:

protected void Page_Load(object sender, EventArgs e)
{
if (Request.Form.AllKeys.Length > 0 &&
Request.Form["__EVENTTARGET"] == "img1")
{
//add button click handler here.
}
}
Luke

Feb 2 '06 #4
Thanks, Luke!
Feb 3 '06 #5

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

Similar topics

8
by: Raphael Gluck | last post by:
Hi Everyone I am having some problems with a master detail page i have set up to catalogue brochures from my site. On my master page www.tripakltd.com/brochures.asp users are invited to select...
4
by: M | last post by:
Hy, I would like to create a master /detail datagrid, that is a datagrid that (when I click on an item) shows some other item's details expanding the rows under the selected grid Can someone...
1
by: Ozgur YASAR | last post by:
Hi, i need to be able to active; on the first page a process is started with a (master) record insert and it will open next page on the next page a datagrid will be used to insert update...
3
by: ivanpais | last post by:
Hi, I have a Web User Control, Lets say "Foo.ascx", that contains a button "btnFoo". I have a Master Page "Bar.master", that has a label "lblBar". This label is exposed by a public property...
0
by: Sam | last post by:
Folks, Attached I am sending 2 URL's from MSFT ASP.net Quick Start Tutorial Web Site. 1) Run it URL: http://www.asp.net/QuickStart/aspnet/samples/data/GridViewMasterDetailsInsertPage_vb.aspx 2)...
1
by: Sam | last post by:
Attached I am sending 2 URL's from MSFT ASP.net Quick Start Tutorial Web Site. 1) Run it URL: http://www.asp.net/QuickStart/aspnet/samples/data/GridViewMasterDetai... 2) View Source URL:...
0
by: Sam | last post by:
Sorry to post the same post multiple times but the URL Addresses were not Correct in Earlier Posts. Here are the correct URL's: 1) Run It URL is here: ...
0
by: plang | last post by:
:confused: I created a travel request form that allows multiple travelers and multiple legs per request. I have a standard form view that collects the traveler info from a main form and fills in the...
4
by: Janet | last post by:
Hi, I'm trying to use the master/detail page to display the information of staff. The master page will display some general information, while the differen detail pages will show the different...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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...

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.