-----------------------------------------------------------

New Message on MumbaiUserGroup

-----------------------------------------------------------
From: Swapnil_B1
Message 1 in Discussion

  
New Validation Controls Properties in ASP.NET 2.0<o:p></o:p> 
ValidateEmptyText  
The ValidateEmptyText property, new in ASP.NET 2.0, fixes an issue with 
CustomValidator. In ASP.NET 1.0 custom validation would not fire if the text of 
the ControlToValidate was empty. You can set this property to true to cause 
custom validation to occur for empty input values.  
Validation Groups  
You can use the ValidationGroup property when you want to perform separate 
validation scenarios on the same page. Set the group name on validator controls 
and on the button or other postback control that causes validation. This is 
useful with Wizard control, MultiView or data controls (for editing scenarios). 
To enable validation groups, set this property to the same value for all 
validators that should belong to a common group. On a Button control in the 
form with CausesValidation set to true, you also set the ValidationGroup 
property to the name of the group that should be validated when the Button is 
clicked. By default all validators are in the "" group (default group), for 
backward compatibility. The Page object also exposes a GetValidators("group") 
method and Validate("group") method for retrieving a collection of validators 
in a specific group. Page.IsValid reflects validity of all controls 
(cumulative) that have had Validate called.  
SetFocusOnError  
Another new validation feature in ASP.NET 2.0 is SetFocusOnError which is set 
on validator controls which causes the first invalid control to receive focus.  
Focus API and DefaultButton  
The Focus API allows you to declaratively or programmatically set focus to 
specific controls on the form. You can use the Page.SetFocus method to pass the 
ID of a control that should receive focus or you can call the Focus method on 
the control directly. You can also set the DefaultFocus property of the Form 
element to the ID of a control that should receive focus when the page is first 
loaded. Similar to DefaultFocus, you can set the DefaultButton property of the 
Form element to the ID of a Button control that should submit when the Enter 
key is pressed inside of any input control on the form. If your page should 
have different default buttons depending on the input control that has current 
focus, you can wrap specific input controls in a Panel control and set the 
DefaultButton property of the Panel instead. Any input control in the Panel 
will use the Panel's DefaultButton property to submit the form when the Enter 
key is pressed from within the input control. A validation feature that depends 
on the Focus API is SetFocusOnError which is set on validator controls to cause 
the first invalid control to receive focus. The following example shows the 
Focus API, DefaultButton, DefaultFocus, and SetFocusOnError features in use on 
a single form.  
Swapnil (Swaps)  
http://swapsnet.spaces.live.com/

-----------------------------------------------------------

To stop getting this e-mail, or change how often it arrives, go to your E-mail 
Settings.
http://groups.msn.com/MumbaiUserGroup/_emailsettings.msnw

Need help? If you've forgotten your password, please go to Passport Member 
Services.
http://groups.msn.com/_passportredir.msnw?ppmprop=help

For other questions or feedback, go to our Contact Us page.
http://groups.msn.com/contact

If you do not want to receive future e-mail from this MSN group, or if you 
received this message by mistake, please click the "Remove" link below. On the 
pre-addressed e-mail message that opens, simply click "Send". Your e-mail 
address will be deleted from this group's mailing list.
mailto:[EMAIL PROTECTED]

Reply via email to