473,382 Members | 1,646 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,382 software developers and data experts.

Default button in aspx

nic
hey,

I have an aspx page with some textboxes and 3 buttons.
How can I set the defaultbutton?

tkx
Nic
Nov 16 '05 #1
2 4670
You can do it programmatically via javascript:

<script language="JavaScript">
mycoolform1.mytextbox1.focus();
</script>
"nic" <ni*@discussions.microsoft.com> wrote in message
news:21**********************************@microsof t.com...
hey,

I have an aspx page with some textboxes and 3 buttons.
How can I set the defaultbutton?

tkx
Nic

Nov 16 '05 #2
Hi,

This will just give the focus to the button, not the intended
functionality, the default button is the one that is activeted when pressed
Enter enywhere in the form

I haven't tried this but you can try one of this solutions:
1- insert a button of type submit :
<input type=submit runat=server onclick=MethodTOCall

2- Intercept the onKeyDown event in the page when you get a return call the
onClick method of the button:
document.onKeyDown="KeyHandler"

KeyHandler( e)
{
// put here the code
}
Cheers,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation

"Ivan G." <iv************@hotmail.com> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl...
You can do it programmatically via javascript:

<script language="JavaScript">
mycoolform1.mytextbox1.focus();
</script>
"nic" <ni*@discussions.microsoft.com> wrote in message
news:21**********************************@microsof t.com...
hey,

I have an aspx page with some textboxes and 3 buttons.
How can I set the defaultbutton?

tkx
Nic


Nov 16 '05 #3

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

Similar topics

1
by: Billy Jacobs | last post by:
Is there a way to make a button on a web form the default button so that when the user hits the enter button the code for that button executes? I have a web page Login.aspx where I have only 1...
2
by: Bratislav Jevtic | last post by:
hi, how to make some push button default on the form? for instance, I've got 2 buttons (Submit, Cancel). submit is on the left, cancel on the right side. on enter key pressed, cancel button is...
4
by: RA | last post by:
Hi I have asp.net web app. When a user clicks the enter key when he is viewing the aspx web form, it jumps to the starting web form. How can I handle the user hitting the enter key and to...
2
by: John Holmes | last post by:
I've added a button to a search page and when the user enters in search criteria in the search text box and hits ENTER I'd like it to behave as if the user clicked the SEARCH button. Is there a way...
3
by: A.M | last post by:
Hi, How can I have an asp.net button as default button? Thanks, Alan
2
by: Goober | last post by:
I have the following default.aspx page that works properly. However, what I want to do is to link the graphics within it (that are hard coded now in the default web page) to our corporate...
4
by: Fred Nelson | last post by:
Hi: I'm a relative newby and I'm writing a C# web application in VS2005. I have several forms with multiple buttons. In 95% of the cases users will click a particular button. I would like...
2
by: AlecL | last post by:
Hi All, I have added a user control onto an aspx page and want to make the submit button of that user control the default button when the panel in which the user control is located is visible. ...
0
by: =?Utf-8?B?bmVlcmFqYkBub2lkYS5ub3NwYW1oY2x0ZWNoLmNv | last post by:
Hi, We have created new .NET web service and running it through the default test page and it's working fine in our development environment. When we moved the web service to the acceptance...
10
by: =?Utf-8?B?SmFtZXMgV29uZw==?= | last post by:
Hi everybody, I'm trying to use the new VB 2008 right now and I want to know how to preset the company name and copyright informtion in Assembly Information. In my current VB 2005, company name...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
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:
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...
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...

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.