Decrease Font Size
Increase Font Size
   BLOG

Extender control ValidatorCalloutExtender cannot extend TextBox

by bryian 6. January 2010 19:52

Extender control 'ValidatorCalloutExtender1' cannot extend 'TextBox1'. Extender controls of type 'AjaxControlToolkit.ValidatorCalloutExtender' cannot extend controls of type 'System.Web.UI.WebControls.TextBox'.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.InvalidOperationException: Extender control 'ValidatorCalloutExtender1' cannot extend 'TextBox1'. Extender controls of type 'AjaxControlToolkit.ValidatorCalloutExtender' cannot extend controls of type 'System.Web.UI.WebControls.TextBox'.

 

Solution: Make sure the TargetControlID of the ValidatorCalloutExtender is set to a validator control instead of the TextBox control

Example:

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

   <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" 
        ErrorMessage="Required field" Display="None" 
        ControlToValidate="TextBox1" />
        
   <cc1:ValidatorCalloutExtender ID="ValidatorCalloutExtender1" 
        TargetControlID="RequiredFieldValidator1" runat="server" />

Comments

1/18/2010 3:39:37 AM #

blue wedding flowers

Is it possible to set Custom Error message for Validator Callouts,I need to Use Validator Callout in our project, but our client need to have control on Error Messages. Which might be that Error messages will be in the xml file ,can we set the error message to custom validator at runtime.

blue wedding flowers India

Add comment


(Will show your Gravatar icon)

  Country flag

Click to change captcha
biuquote
  • Comment
  • Preview
Loading