C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Communities   Interview   Jobs   Projects   Offshore Development    
Silverlight Tutorials | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Revenue Sharing |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...

New Feature: Community Sites: Create your own .NET community website and start earning from Google AdSense ! It's Free !






ASP.NET Ajax Control (TextBoxWatermarkExtender,ValidatorCalloutExtender)


Posted Date: 20 Dec 2007    Resource Type: Articles    Category: Web Applications

Posted By: Kamal       Member Level: Gold
Rating:     Points: 15



Here I demonstrate how to use AJAX Control TextBoxWatermarkExtender and ValidatorCalloutExtender in ASP.NET.


<asp:TextBox ID="txtFname" runat="server"/>
<asp:RequiredFieldValidator ID="rfvFname" runat="server" ErrorMessage="Enter First Name"
ControlToValidate="txtFname" Display="None" ValidationGroup="vgCheck"/>
<ajaxToolkit:TextBoxWatermarkExtender ID="twFname" runat="server" TargetControlID="txtFname"
WatermarkText="Enter First Name"/>
<ajaxToolkit:ValidatorCalloutExtender ID="vcFname" runat="server" TargetControlID="rfvFname"/>
<br />
<asp:Button ID="btnSubmit" runat="server" Text="Submit" ValidationGroup="vgCheck" />


TextBoxWatermarkExtender : This Ajax control attached to Textbox control to get WaterMark behavior. When Textbox control is empty it display Watermark text.To attach TextBoxWatermarkExtender to TextBox set TargetControlId of TextBoxWatermarkExtender to particular TextBox.

Here,I set TargetControlID of twFname to txtFname and set WatermarkText for txtFname.
You can also use Css Class with watermark contol.

ValidatorCalloutExtender : This Ajax control enhances the functionality of existing ASP.NET validators. To use this control, add an input field and a validator control as you normally would. Then add the ValidatorCallout and set its TargetControlID property to reference the validator control.

Here, I use rfvFname RequiredFieldValidator control to validate txtFname TextBox control. To use ValidatorCalloutExtender I set TargetControlID to rfvFname RequiredFieldValidator.

So,both control TextBoxWatermarkExtender,ValidatorCalloutExtender ASP.NET AJAX Control is very easy to understand and use to it.




Responses


No responses found. Be the first to respond and make money from revenue sharing program.

Feedbacks      
Popular Tags   What are tags ?   Search Tags  
(No tags found.)

Post Feedback


This is a strictly moderated forum. Only approved messages will appear in the site. Please use 'Spell Check' in Google toolbar before you submit.
You must Sign In to post a response.
Next Resource: Sending Email with ASP.NET 2.0
Previous Resource: What's New in ASP.NET 2.0
Return to Discussion Resource Index
Post New Resource
Category: Web Applications


Post resources and earn money!
 
Related Resources



dotNet Slackers   BizTalk Adaptors    Web Design

efax

Contact Us    Privacy Policy    Terms Of Use