radwindow login sample

5 posts, 0 answers
  1. Michael
    Michael avatar
    17 posts
    Member since:
    Sep 2011

    Posted 06 Oct 2012 Link to this post

    Is there an up to date radwindow login control anywhere? Preferably using 2011q2 lib?
  2. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 08 Oct 2012 Link to this post

    Hi Michael,

    I suppose you want to create a login form inside the RadWindow. You can use the following approaches.

    1)One suggestion is that you can add the login controls inside the ContentTemplate of the RadWindow as follows.

    ASPX:
    <telerik:RadWindowManager ID="RadWindowManager1" runat="server">
       <Windows>
         <telerik:RadWindow ReloadOnShow="true" ID="LoginWindow" runat="server">
            <ContentTemplate>
                User:
                <asp:TextBox ID="TextBox2" runat="server" AutoCompleteType="Disabled"></asp:TextBox><br />
                Password:  <asp:TextBox ID="TextBox1" runat="server" TextMode="Password"></asp:TextBox><br />
                <asp:Button ID="Button1" runat="server" OnClick="Button1_Click" Text="Check" /><br />
                <asp:Label ID="Label1" runat="server"></asp:Label>
            </ContentTemplate>
         </telerik:RadWindow>
       </Windows>
    </telerik:RadWindowManager>

    C#:
    protected void Button1_Click(object sender, EventArgs e)
        {
            if (TextBox1.Text == "admin" && TextBox2.Text == "admin")
            {
                Response.Write("Login successful");
                Label1.Text = "<script type='text/javascript'>top.location.href='http://google.com';GetRadWindow().Close();</script>";
            }
            else
            {
                Response.Write("Invalid login credentials");
            }
        }

    2)Another approach is that you can add the controls inside another aspx page as shown in this code library.

    Hope this helps.

    Regards,
    Shinu.
  3. Michael
    Michael avatar
    17 posts
    Member since:
    Sep 2011

    Posted 11 Oct 2012 Link to this post

    I started by using a loginview inside user control. Added a link button, radwindow. Inside the radwindow I added a asp login. The link button onclick handler loginpopup.visibleonpageload=true. This reloads the page then shows the radwindow. Is there another way to load the radwindow without reloading the page?
  4. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 11 Oct 2012 Link to this post

    Hi Michael,

    The VisibleOnPageLoad property should not be used for this purpose. It is a behavior property which will result in the RadWindow opening every time the page is post back. Following is the sample code that I tried to open a RadWindow on click of a LinkButton.

    ASPX:
    <telerik:RadWindowManager ID="RadWindowManager1" runat="server">
      <Windows>
         <telerik:RadWindow ID="RadWindow1" runat="server">
         </telerik:RadWindow>
      </Windows>
    </telerik:RadWindowManager>
    <asp:LinkButton ID="LinkButton1" runat="server" Text="LinkButton1" OnClick="LinkButton1_Click"></asp:LinkButton>

    C#:
    protected void LinkButton1_Click(object sender, EventArgs e)
        {
            string scriptstring = "<script language='javascript'>function f(){var oWnd = radopen('', 'RadWindow1');}; Sys.Application.add_load(f);</script>";
            Page.ClientScript.RegisterStartupScript(this.GetType(), "radalert", scriptstring);
        }

    Please take a look into this documentation for more information.

    Regards,
    Princy.
  5. rdmptn
    rdmptn avatar
    72 posts
    Member since:
    Aug 2011

    Posted 11 Oct 2012 Link to this post

    Or just use the OnClientClick property of the button and prevent the postback
    <asp:LinkButton runat="server" ID="LinkButton1" OnClientClick="openRw(); return false;"></asp:LinkButton>

    function  openRw(){

    $find("<Your RadWindow's ClientID>").show();

    }

Back to Top