"Default" button in ASP.Net Form
"Default" button in ASP.Net Form
"Default" button in ASP.Net Form
"Default" button in ASP.Net Form
"Default" button in ASP.Net Form
"Default" button in ASP.Net Form "Default" button in ASP.Net Form "Default" button in ASP.Net Form "Default" button in ASP.Net Form "Default" button in ASP.Net Form "Default" button in ASP.Net Form "Default" button in ASP.Net Form "Default" button in ASP.Net Form
"Default" button in ASP.Net Form "Default" button in ASP.Net Form
"Default" button in ASP.Net Form
Go Back  Xtreme Visual Basic Talk > > > "Default" button in ASP.Net Form


Reply
 
Thread Tools Display Modes
  #1  
Old 07-17-2007, 11:25 AM
Aquila's Avatar
Aquila Aquila is offline
Contributor
 
Join Date: Oct 2002
Location: Ocala, Fl.
Posts: 597
Default "Default" button in ASP.Net Form


How do I set the default button in a asp.net form?
The button that is "clicked" when a user just presses enter.
__________________
Plotting to take over the world since 1978
Reply With Quote
  #2  
Old 07-18-2007, 03:17 PM
torpkevuk's Avatar
torpkevuk torpkevuk is offline
Contributor
 
Join Date: Oct 2003
Location: Nebraska, USA
Posts: 640
Default

at the start of my application what I did was to set the tabindex of each control at runtime.. theres probably a better way of doing it though
Reply With Quote
  #3  
Old 07-18-2007, 04:56 PM
Eduardo Lorenzo's Avatar
Eduardo Lorenzo Eduardo Lorenzo is offline
Senior Contributor
 
Join Date: Jun 2006
Location: Manila, Philippines
Posts: 846
Default

Quote:
Private Sub SetFocus(ByVal ctrl As Control)
' Define the JavaScript function for the specified control.
Dim focusScript As String = "<script language='javascript'>" & _
"document.getElementById('" + ctrl.ClientID & _
"').focus();</script>"

' Add the JavaScript code to the page.
Page.RegisterStartupScript("FocusScript", focusScript)
End Sub
this java function will set the focus to a control.
__________________
Pinoy ako.. ipinagmamalaki ko.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
&quot;Default&quot; button in ASP.Net Form
&quot;Default&quot; button in ASP.Net Form
&quot;Default&quot; button in ASP.Net Form &quot;Default&quot; button in ASP.Net Form
&quot;Default&quot; button in ASP.Net Form
&quot;Default&quot; button in ASP.Net Form
&quot;Default&quot; button in ASP.Net Form &quot;Default&quot; button in ASP.Net Form &quot;Default&quot; button in ASP.Net Form &quot;Default&quot; button in ASP.Net Form &quot;Default&quot; button in ASP.Net Form &quot;Default&quot; button in ASP.Net Form &quot;Default&quot; button in ASP.Net Form
&quot;Default&quot; button in ASP.Net Form
&quot;Default&quot; button in ASP.Net Form
 
&quot;Default&quot; button in ASP.Net Form
&quot;Default&quot; button in ASP.Net Form
 
-->