Telerik is a leading vendor of ASP.NET AJAX, ASP.NET MVC, Silverlight, WinForms and WPF controls and components, as well as .NET Reporting, .NET ORM , .NET CMS, Code Analysis, Mocking, Team Productivity and Automated Testing Tools. Building on its expertise in interface development and Microsoft technologies, Telerik helps customers build applications with unparalleled richness, responsiveness and interactivity. Telerik products help thousands of companies to be more productive and deliver reliable applications under budget and on time.
Version Q2 2011 released 07/12/2011
select

Button / Sign Up Form

Female Male
Subscribe to Newsletter
Subscribe to RSS Feeds

  • SingUp Form

    This example demonstrates how you can use the RadButton control to customize the look of your SignUp form. You can use the client-side or server-side API to submit the page, and collect the information entered.

    Two RadButton controls with ButtonType="ToggleButton" and ToggleType="Radio" are used to determine the gender of the user. Another, two toggle buttons (RadButton with ButtonType="ToggleButton") are used to subscribe the user for the provided services.

    The remaining buttons, are image buttons where the image is either used as background, or represents the button itself (ImageButton).

Source Code

C# VB.NET
Show code in new window Demo isolation steps
  • <%@ Page Language="c#" AutoEventWireup="true" %>

    <%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
    <%@ Register TagPrefix="qsf" Namespace="Telerik.QuickStart" %>
    <%@ Register TagPrefix="qsf" TagName="Header" Src="~/Common/Header.ascx" %>
    <%@ Register TagPrefix="qsf" TagName="HeadTag" Src="~/Common/HeadTag.ascx" %>
    <%@ Register TagPrefix="qsf" TagName="Footer" Src="~/Common/Footer.ascx" %>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
        <qsf:HeadTag ID="Headtag1" runat="server" />
        <style type="text/css">
            .signUpScenario
            {
                width: 415px;
                height: 328px;
                margin: auto;
                background-image: url(img/signUpBgr.png);
            }
            
            .signUpScenario, .signUpScenario input
            {
                font-family: "Segoe UI" ,Arial,Helvetica,sans-serif;
                font-size: 12px;
            }
            .signUpHeader
            {
                position: relative;
                height: 56px;
            }
            .signUpBody
            {
                padding: 25px;
            }
            .signButton
            {
                position: absolute;
                top: 19px;
                right: 10px;
                width: 75px;
                height: 22px;
            }
            .formElements
            {
                clear: both;
                padding-bottom: 32px;
            }
            .formElements label
            {
                display: block;
                float: left;
                width: 70px;
                height: 22px;
                line-height: 22px;
                text-align: right;
                padding-right: 7px;
            }
            .formElements .itext
            {
                display: block;
                float: left;
                width: 218px;
                height: 22px;
                padding: 0 10px;
                line-height: 22px;
                border: 0;
                background-color: transparent;
                background-image: url(img/signUpInputBgr.png);
                background-repeat: no-repeat;
            }
            .subscription
            {
                width: 200px;
                margin: -15px 0 0 80px;
            }
            .signUp
            {
                width: 220px;
                margin: 20px 0 0 80px;
            }
            .rbMail16
            {
                background-position: -456px 0 !important;
            }
            .rbRSS16
            {
                background-position: -432px 0 !important;
            }
            
            /*IE6 Fixes*/
            *html .signButton .rbImageButton
            {
                background-image: url(img/signInBtn.gif) !important;
            }
            *html .signButton .rbImageButton:hover
            {
                background-image: url(img/signInBtnHov.gif) !important;
            }
            *html .formElements .itext
            {
                background-image: url(img/signUpInputBgr.gif);
            }
        </style>
    </head>
    <body class="BODY">
        <form id="Form2" method="post" runat="server">
        <qsf:Header ID="Header1" runat="server" NavigationLanguage="c#" ShowSkinChooser="false" />
        <telerik:RadScriptManager ID="ScriptManager" runat="server" />
        <div class="signUpScenario">
            <div class="signUpHeader">
                <div class="signButton">
                    <telerik:RadButton ID="ImageButton" runat="server" Width="75px" Height="22px" Text="Click Here to Sign in">
                        <Image ImageUrl="img/signInBtn.png" HoveredImageUrl="img/signInBtnHov.png" />
                    </telerik:RadButton>
                </div>
            </div>
            <div class="signUpBody">
                <div class="formElements">
                    <label for="Name">
                        Name:</label>
                    <input type="text" class="itext" />
                </div>
                <div class="formElements">
                    <label for="Password">
                        Password:</label>
                    <input type="password" class="itext" />
                </div>
                <div class="formElements">
                    <label for="Gender">
                        Gender:</label>
                    <telerik:RadButton ID="btnFemale" runat="server" ButtonType="ToggleButton" ToggleType="Radio"
                        AutoPostBack="false" Text="Female" Width="75px" Height="22px" ForeColor="Black"
                        GroupName="Gender">
                        <ToggleStates>
                            <telerik:RadButtonToggleState ImageUrl="img/btnHov.png" Selected="true" IsBackgroundImage="true" />
                            <telerik:RadButtonToggleState ImageUrl="img/btn.png" HoveredImageUrl="img/btnHov.png"
                                IsBackgroundImage="true" />
                        </ToggleStates>
                    </telerik:RadButton>
                    <telerik:RadButton ID="btnMale" runat="server" ButtonType="ToggleButton" ToggleType="Radio"
                        AutoPostBack="false" Text="Male" Width="75px" Height="22px" ForeColor="Black"
                        GroupName="Gender">
                        <ToggleStates>
                            <telerik:RadButtonToggleState ImageUrl="img/btnHov.png" Selected="true" IsBackgroundImage="true" />
                            <telerik:RadButtonToggleState ImageUrl="img/btn.png" HoveredImageUrl="img/btnHov.png"
                                IsBackgroundImage="true" />
                        </ToggleStates>
                    </telerik:RadButton>
                </div>
                <div class="subscription">
                    <div>
                        <telerik:RadButton ID="btnNewsletter" runat="server" ButtonType="ToggleButton" ToggleType="CheckBox"
                            AutoPostBack="false" Width="38px" Height="22px" ToolTip="Subscribe to Newsletter">
                            <Icon PrimaryIconUrl="~/Button/img/rbPredefinedIcons.png" PrimaryIconCssClass="rbMail16"
                                PrimaryIconTop="5px" PrimaryIconLeft="10px" />
                            <ToggleStates>
                                <telerik:RadButtonToggleState ImageUrl="img/smallBtnHov.png" Selected="true" IsBackgroundImage="true" />
                                <telerik:RadButtonToggleState ImageUrl="img/smallBtn.png" HoveredImageUrl="img/smallBtnHov.png"
                                    IsBackgroundImage="true" />
                            </ToggleStates>
                        </telerik:RadButton>
                        <span>Subscribe to Newsletter</span>
                    </div>
                    <div style="padding-top: 5px">
                        <telerik:RadButton ID="btnRss" runat="server" ButtonType="ToggleButton" ToggleType="CheckBox"
                            AutoPostBack="false" Width="38px" Height="22px" ForeColor="Black" ToolTip="Subscribe to RSS Feeds">
                            <Icon PrimaryIconUrl="~/Button/img/rbPredefinedIcons.png" PrimaryIconCssClass="rbRSS16"
                                PrimaryIconTop="3px" PrimaryIconLeft="10px" />
                            <ToggleStates>
                                <telerik:RadButtonToggleState ImageUrl="img/smallBtnHov.png" Selected="true" IsBackgroundImage="true" />
                                <telerik:RadButtonToggleState ImageUrl="img/smallBtn.png" HoveredImageUrl="img/smallBtnHov.png"
                                    IsBackgroundImage="true" />
                            </ToggleStates>
                        </telerik:RadButton>
                        <span>Subscribe to RSS Feeds</span>
                    </div>
                </div>
                <div class="signUp">
                    <telerik:RadButton ID="RadButton5" runat="server" Width="112px" Height="28px" Text="Submit the Form to Sign Up">
                        <Image ImageUrl="img/signUpBtn.png" HoveredImageUrl="img/signUpBtnHov.png" />
                    </telerik:RadButton>
                    <telerik:RadButton ID="RadButton6" runat="server" Width="89px" Height="22px" Text="Cancel">
                        <Image ImageUrl="img/cancel.png" HoveredImageUrl="img/cancelHov.png" />
                    </telerik:RadButton>
                </div>
            </div>
        </div>
        <qsf:Footer runat="server" ID="Footer1" ShowCodeViewer="true" />
        </form>
    </body>
    </html>

Get more than expected!

 
 

Take your time to truly experience the power of RadControls for ASP.NET AJAX with a free 60-day trial backed up by Telerik’s unlimited dedicated support.

Download your RadControls for ASP.NET AJAX trial and jumpstart your development with the available Getting Started resources.

If you have any questions, do not hesitate to contact us at sales@telerik.com.

Copyright 2002-2024 © Telerik. All right reserved
Telerik Inc, 201 Jones Rd, Waltham, MA 02451