473,804 Members | 3,475 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 2040
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='javas cript'>
function run()
{
alert('hello');
}
</script>
<BODY onLoad="documen t.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
RegisterClientS criptBlock statement to generate client-side script from the
code-behind file.

HTH,
-Azhagan


"Jac" <Ja*@discussion s.microsoft.com > wrote in message
news:AA******** *************** ***********@mic rosoft.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
5360
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
8569
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 way you could set it as the "cancel" button too, wasn't there? Anyway, can you do this with windows forms button? Thanks in advance! Derrick
15
4058
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 CALLING FORM! This is very bad for me, because in my application, Form1 responds to an ENTER keypress by calling Form2. If the user closes Form2 via an ENTER, then Form1 just reopens it again, kind of trapping the user in Form2 (they can still close...
1
1788
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. It's AcceptButton is set to btnExport and the CancelButton is set to btnCancel. btnExport on FormFinish has no event code whatsoever (not even for click.) When the user either clicks the button or presses enter on the
5
5433
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
4824
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 default. It's not there now. I found in the help index an isdefault property and tried to set it in code but it doesn't show up in the list when I type button1.isdef
2
4106
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. I would like to use the acceptbutton property of its parent form when the "enter" key is pressed. Something like that. private void txtAutocomp_KeyDown(object sender, System.Windows.Forms.KeyEventArgs e)
1
4784
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 have this small easy program below which show two buttons called button1 and button2. In this program when the Enter key is clicked event handler for button1 is called.
2
1371
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 button's event.
0
9708
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10340
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10327
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10085
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7625
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6857
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5663
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4302
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3828
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.