call telerik:RadCaptcha inside CreateUserWizard

2 posts, 0 answers
  1. Charles
    Charles avatar
    5 posts
    Member since:
    Nov 2010

    Posted 16 Nov 2010 Link to this post

    On the following code,

      <asp:CreateUserWizard ID="CreateUserWizard1" runat="server" OnCreatedUser="insertVal" ContinueDestinationPageUrl="~/default.aspx" CreateUserButtonStyle-CssClass="buttonEnable" OnCreatingUser="CreateUserWizard1_CreatingUser" OnCreateUserError="createUserFail">
                    <asp:CreateUserWizardStep ID="CreateUserWizardStep1" runat="server">
                            <table border="0" width=100%>
           <tr><td colspan="3">
            <telerik:RadFormDecorator ID="RadFormDecorator1" runat="server"/>
        <div >
            <table border=0 width=250 height=120>
                    <td align=center>
                    <asp:Label ID="lblErrorMessage" runat="server" ForeColor="Red" ></asp:Label>
                        <telerik:RadCaptcha ID="RadCaptcha1" runat="server" ErrorMessage="The code is not valid."
                            ValidationGroup="CreateUserWizard1" ValidatedTextBoxID="rcTextBox1" Display=none>
                            <CaptchaImage  RenderImageOnly="true"  BackgroundColor="white" TextColor="Black" BackgroundNoise="None" />
                        </telerik:RadCaptcha><br />
                        <asp:Label ID="rcLabel1" runat="server" AssociatedControlID="rcTextBox1"><h3>Type the code from the image:</h3></asp:Label>
                         <asp:TextBox ID="rcTextBox1" runat="server" MaxLength="5" Width="170px"></asp:TextBox>
        <telerik:RadScriptBlock ID="RadScriptBlock1" runat="server">

    How do you call RadCaptcha1 when it's inside <asp:CreateUserWizard .

    I have tried those but it does not work



    Not RadCaptcha1.IsValid Then


    end if

    If Not CreateUserWizard1.CreateUserStep.ContentTemplateContainer.FindControl("RadCaptcha1").IsValid Then


    end if

  2. Pero
    Pero avatar
    1156 posts

    Posted 19 Nov 2010 Link to this post

    Hi Charles,

    The FindControl method always returns an object of type Control. You first need to cast the control found by the method to a RadCaptcha control.

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs) Handles Me.Load
        Dim captcha As RadCaptcha = DirectCast(CreateUserWizard1.CreateUserStep.ContentTemplateContainer.FindControl("RadCaptcha1"), RadCaptcha)
        Page.Title = captcha.CaptchaImage.Text
    End Sub

    All the best,
    the Telerik team
    Browse the vast support resources we have to jumpstart your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
Back to Top