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

Aspx default acceptbutton

Jac
Hey,

How can I set the defaut accept button in an aspx-page.

In some screens I see in acceptbutton but I see know difference between this
button properties and the others.

Thanks Jac
Nov 16 '05 #1
1 2020
Hi Jac,

There are two ways to go about this.

Option 1: Write inline HTML code to set a button as the default. Here
is a sample....

<script language='javascript'>
function run()
{
alert('hello');
}
</script>
<BODY onLoad="document.all('btnDone').focus();">
This is a sample line. <BR>
This is another sample line. <BR><BR>
<INPUT id='btnDone' type='button' value='Done' onClick='run();'>
</BODY>

Option 2: You can do the same.... but from the code-behind file, which
will generate an equivalent HTML file. You can use
RegisterClientScriptBlock statement to generate client-side script from the
code-behind file.

HTH,
-Azhagan


"Jac" <Ja*@discussions.microsoft.com> wrote in message
news:AA**********************************@microsof t.com...
Hey,

How can I set the defaut accept button in an aspx-page.

In some screens I see in acceptbutton but I see know difference between this button properties and the others.

Thanks Jac

Nov 16 '05 #2

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

Similar topics

6
by: Marre | last post by:
Hi all! I have a form with a lot of buttons on it. Doés anyone knows how to set one of this buttons to default when I press enter? /Marre
7
by: Derrick | last post by:
Didn't there used to be some property where you could set a button to be the "default" so that if a user pressed enter with any control in focus, the button would still get the click event? Some...
15
by: Adam J. Schaff | last post by:
I have noticed that if a user closes a form via pressing return (either while the OK button has focus or if AcceptButton is set to OK for the form) then the "ENTER" keypress event fires ON THE...
1
by: Jeff | last post by:
Hello all. I'm trying to figure out exactly what is going on here. I'm getting different results on different forms, and it's driving me nuts. For example, I have a form called FormFinish....
5
by: Wonder | last post by:
How can I create or use the msgobx to show a message without a default button. The user has explicity to click on the button, so the msgbox closes it. Thanks,
10
by: cj | last post by:
Here's an easy one, I hope. How do I make button1, which I put on this form from the toolbox, the default button on the form? I thought it used to be a property in the properties window called...
2
by: Barney | last post by:
Hi, This is my first query in google groups. I expect to don´t do it wrong, and excuse me for my english, i haven´t used it for years... I´m making a user component that inherits from a textbox....
1
by: Tony Johansson | last post by:
Hello! I'm reading a book which mentioned about this AcceptButton property for a form which seems quite easy so I try to figure out how it works but I have run into some small problems. I...
2
by: =?Utf-8?B?R3JlZw==?= | last post by:
What's the equivilant in VB.Net 2005 for the Default Property. For example, if I set the Default Property to TRUE for a btnPrint button, pressing the ENTER key will automatically invoke that...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

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.