Hi,
I m trying to add ValidatorCalloutExtender in code behind but getting this error "Unable to find control id 'ctl00_ContentPlaceHolder2_TextBox_firmaunvani' referenced by the 'ControlToValidate' property of 'r_TextBox_firmaunvani'."
Any help please?
Thanks in advance
Best Regards
Here is the code
html
and vb
I m trying to add ValidatorCalloutExtender in code behind but getting this error "Unable to find control id 'ctl00_ContentPlaceHolder2_TextBox_firmaunvani' referenced by the 'ControlToValidate' property of 'r_TextBox_firmaunvani'."
Any help please?
Thanks in advance
Best Regards
Here is the code
html
HTML:
<asp:UpdatePanel runat="server" ID="UpdatePanel2">
<ContentTemplate>
<asp:TextBox runat="server" ID="TextBox_firmaunvani" Text=""></asp:TextBox>
<asp:Button ID="Button1" runat="server" Text="<%$ Resources:OdemeTalep, Button1 %>"
CausesValidation="False" />
</ContentTemplate>
</asp:UpdatePanel>
and vb
VB.NET:
If String.IsNullOrEmpty(TextBox_firmaunvani.Text) Then
Dim v_VCALLOUT As New AjaxControlToolkit.ValidatorCalloutExtender
Dim r_VALIDATOR As New System.Web.UI.WebControls.RequiredFieldValidator
With r_VALIDATOR
.ID = "r_" & TextBox_firmaunvani.ID
.ControlToValidate = "ctl00_ContentPlaceHolder2_" + TextBox_firmaunvani.ID
.Display = ValidatorDisplay.None
.Font.Name = "Verdana"
.Font.Size = FontSize.XSmall
End With
Me.Page.Controls.Add(r_VALIDATOR)
With v_VCALLOUT
.ID = "v_" & r_VALIDATOR.ID
.Width = New Unit(200)
.HighlightCssClass = "highlight"
.WarningIconImageUrl = "~/images/warning.gif"
.CloseImageUrl = "~/images/close.gif"
.TargetControlID = r_VALIDATOR.ID
.Enabled = True
End With
Select Case Thread.CurrentThread.CurrentCulture.Name
Case "tr-TR"
With r_VALIDATOR
.ErrorMessage = " Firma Ünvanı Girip Getir Düğmesine Basın!"
End With
Case "en-US"
With r_VALIDATOR
.ErrorMessage = " Enter Company Name and Press Find Button!"
End With
End Select
Me.Page.Controls.Add(v_VCALLOUT)
TextBox_firmaunvani.Focus()
Exit Sub
End If