views:

183

answers:

1

iam having a problem finding a textbox inside createuserwizard which is inside a contentplaceholder

i have a custom validator for this textbox ..now when i put this customvalidator outside createuser wizard it says "cannot find controltovalidate control id CaptchaValue "

heres is a row inside my createuserwizard

 <CreateUserWizard......>

        :
        :
        :
 tr>  
<td align="left">
<asp:TextBox ID="CaptchaValue" runat="server" CssClass="texty"></asp:TextBox>                                                                                </td>
</tr>

        :
        :
        :

    </CreateUserWizard>

and i have a customevalidator outside createuserwizard

 <asp:CustomValidator ID="CustomValidator5" runat="server" ControlToValidate="CaptchaValue"
                                                                               ErrorMessage="Image value must match" ValidationGroup="CreateUserWizard1" 
                                                                               EnableClientScript="False"></asp:CustomValidator>
A: 

Put it inside the CreateUserStep and then access the value like so:

CustomValidator cv = (CustomValidator)this.CreateUserWizard1.CreateUserStep.ContentTemplateContainer.FindControl("CustomValidator5");
Junto