Article
    C#
    ADO.Net
    .NET
    ASP.Net & Web Forms
    Custom Controls
    Web Development
    Exception Handling
    XML
    Database
    Security in .Net
    Testing
    Web Services
    Windows Services
    Windows Controls
    WCF
    AJAX
    WPF
    XAML
    Reporting
    Setup
    VB.Net
    LINQ
    JQuery
    SilverLight
    JavaScript
    HTML5
    Crystal Report
    Cloud Computing
    Share Point
    Visual C++
    MVC
    Android
    PHP
    Java
    HTML
    WordPress
    Joomla
    Products
    Drupal
    Windows Phone
    JSON
    LightSwitch
    iPhone/iPad
    Ruby on Rails
    IIS 7
    Windows 8
    CSS/CSS3
    Excel
    MS Access
    Shortcut Keys
    Visual SourceSafe
    Team Foundation Server
    API(s)
    Sencha-Touch
    Single Page App
    Bootstrap
Follow Us
Follow _MindStick_ on Twitter View MindStick Software's LinkedIn profile View MindStick Software's Facebook profile
Top Contributor
Advertisement
Advertise with Us
Mindstick
Article Article  Forum Forum  Blog Blog  Quiz Quiz  Beginner Beginner  Careers Careers  Contact Contact  Login Login  
Home | Product | Services | About Us | Interview | DeveloperSection | Submit an Article | Submit Blog

Home >> AJAX >> Ajax Toolkit ValidatorCalloutExtender Control in ASP.Net
Ajax Toolkit ValidatorCalloutExtender Control in ASP.Net
Ajax Toolkit ValidatorCalloutExtender Control in ASP.Net


by Pushpendra Singh on 12/5/2010 4:47:56 PM

Views: 8108       Comments: 0

Ajax Toolkit ValidatorCalloutExtender Control in ASP.Net

ValidatorCallout is an ASP.NET AJAX extender that 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.

ValidatorCallout Properties:

·         TargetControlID - The ID of the Validator to extend

·         Width - The width of the callout

·         WarningIconImageUrl - The path to a custom warning icon image

·         CloseImageUrl - The path to a custom close image

Code:

<%-- ScriptManager control manages client script for AJAX enabled ASP.NET pages.This enables partial-page rendering and Web-service calls.You have to used this if you want to use ajax control--%>

<asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>

<%--Add the ValidatorCalloutExtender and some control--%>

<cc1:ValidatorCalloutExtender ID="ValidatorCalloutExtender1" runat="server" TargetControlID="RequiredFieldValidator1">

</cc1:ValidatorCalloutExtender>

 

<cc1:ValidatorCalloutExtender ID="ValidatorCalloutExtender2" runat="server" TargetControlID="RequiredFieldValidator2">

</cc1:ValidatorCalloutExtender>

 

<asp:Label ID="Label1" runat="server" Text=" Name"></asp:Label>

<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>

<asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ErrorMessage="Enter your name" ControlToValidate="TextBox1" Display="None"></asp:RequiredFieldValidator>

<br />

<asp:Label ID="Label2" runat="server" Text="Phone number"></asp:Label>

<asp:TextBox ID="TextBox2" runat="server" MaxLength="10"></asp:TextBox>

<asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ErrorMessage="Enter you phone number" Display="None"

ControlToValidate="TextBox2"> </asp:RequiredFieldValidator>

</div>

<p>

<asp:Button ID="Button1" runat="server" Text="Submit" onclick="Button1_Click" />

</p>

<p>&nbsp;</p>

<asp:Label ID="Label3" runat="server"></asp:Label>

Display message of RequiredFieldValidator should be "None"( Display="None")

Run the project

AjaxControl Toolkit ValidatorCalloutExtender Control in ASP.Net

AjaxControl Toolkit ValidatorCalloutExtender Control in ASP.Net

When you click Submit button then error message will show

 

When you enter Name and click button then error message will show for second Textbox

AjaxControl Toolkit ValidatorCalloutExtender Control in ASP.Net

Enter Name and phone number and click Submit button then message will show in Label

AjaxControl Toolkit ValidatorCalloutExtender Control in ASP.Net

Report Abuse Form
Reason:    
 

Title :
Comment :
Text ColorBackground Color
BoldItalicUnderline
LeftCenterRightJustify
Ordered ListBulleted List
IndentOutdent
Horizontal Rule
SubscriptSuperscript
HyperlinkImage
Design ModeDesign
View HtmlHtml
     
 
Latest Article by Pushpendra SinghRSS Feed
    
    
    
    
    
    
    
    
    
    
More...
Latest BlogsRSS Feed
    
    
    
    
    
    
    
    
    
    
More...
Top Viewed ArticlesRSS Feed
    
    
    
    
    
    
    
    
    
    
Top Viewed BlogsRSS Feed
    
    
    
    
    
    
    
    
    
    
Latest Interview QuestionsRSS Feed
    
    
    
    
    
    
    
    
    
    
More...
Total Online Users: 4967
Advertisement
MindStick Cleaner
Advertise with Us
  
Copyright © 2014MindStick. All Rights Reserved.