Where is my validator?

Posted by Danny Chen on Stack Overflow See other posts from Stack Overflow or by Danny Chen
Published on 2010-06-10T07:23:19Z Indexed on 2010/06/10 7:32 UTC
Read the original article Hit count: 478

Filed under:
|
|
|

I have a validator in my page:

<asp:RequiredFieldValidator ID="rfv1" runat="server" ControlToValidate="IdentifySEDSED1TxtDate" ErrorMessage="Significant Event Date 1 is missing" ValidType="SEDate">*</asp:RequiredFieldValidator>

I found that in Page_Load: (below is a screen shot from the Watch Window)

this.FindControl("rfv1")    {Text = "*"}    

rfv1    The name 'rfv1' does not exist in the current context

See, I can get this control with FindControl, but I can't get it using ID directly! What happens?

© Stack Overflow or respective owner

Related posts about c#

Related posts about ASP.NET