ASP.NET Whidbey Overview
page 11 of 14
by Steven Smith
Feedback
Average Rating: 
Views (Total / Last 10 Days): 57206/ 52

Client-Side Features

ASP.NET 2.0 has some frequently requested client side features, as well.  First, it was way too hard to add client side click handlers in ASP.NET 1.x (using the Attributes collection), so now there is an OnClientClick property that can be used.

Another frequent request was to improve support for client-side Focus.  Several features have been added to address this, including a Page.SetFocus(control) method which works today in the alpha builds of VS2005.  You can also declaratively set the default focus of a form by specifying a DefaultFocus in the <form> tag.  This also supports a DefaultButton property, which will ensure that when the user hits enter, that button is clicked.  I know these features will handle a LOT of frequent questions on several lists and forums I frequent.  Example syntax:

 <form DefaultFocus=“textbox1” DefaultButton="button1" runat=“server”>

You'll also be able to specify an individual control and call its Focus() method to set focus to that control.  With the current build (March 2004 Preview) I'm not having much luck with the <form> and .Focus() techniques, but the Page.SetFocus(control) method has worked since before the PDC03 preview bits.

The validation controls also have a new property, SetFocusOnError (boolean), which will set the focus to the first control on the page that had a validator fail.  This seems to be working currently.


View Entire Article

User Comments

Title: very good article   
Name: raja raja
Date: 2009-12-04 7:57:23 AM
Comment:
very good and informative website.
Title: nice artical   
Name: abdulla hussein
Date: 2007-04-29 6:28:16 AM
Comment:
I like it , it is very informative . thanks alot man

Product Spotlight
Product Spotlight 





Community Advice: ASP | SQL | XML | Regular Expressions | Windows


©Copyright 1998-2024 ASPAlliance.com  |  Page Processed at 2024-04-17 9:11:25 PM  AspAlliance Recent Articles RSS Feed
About ASPAlliance | Newsgroups | Advertise | Authors | Email Lists | Feedback | Link To Us | Privacy | Search