Where is my validator?
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:Requi开发者_JS百科redFieldValidator>
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?
If you are finding the panels on the page, you need to find them in the form of the page, as panels are placed inside the form, but not on the page directly.
Atleast I assume that this is the problem....
does this work:
this.Form.FindControl(rfv1);
精彩评论