Saturday, 16 August 2014

Register Page Using Standard Controls in the .NET Framework 4.0

Register Page Using Standard Controls in the                       .NET Framework 4.0

                             Register.aspx

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="REGISTER.aspx.cs" Inherits="using_standard_control.REGISTER" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
</head>
<body background=abstract-orange-background-wallpaper.jpg>
    <%--//////////////////give bachground image here/////////////////--%>
    
    <form id="form1" runat="server">
    <%--//////////////////heading of page////////////////--%>
    <div align=center><h1><font color=navy>  
        Registration Form Page </font></h1></div>
        <hr>
        <br />
        <div align=center>
    &nbsp;&nbsp;&nbsp;&nbsp;<img src="WEB-hdr-REGISTRATION.jpg" align="middle" height="100" width="600" />
    </div>
        <br>
        <%--/////////////////registration form attrubutes starts from here///////////////////--%>
    <p align=center>
        First Name&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        <asp:TextBox ID="txt_firstname" runat="server" Width="353px" 
            BorderStyle="Solid"></asp:TextBox>
    </p>
    <p align=center>
        Last Name&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        <asp:TextBox ID="txt_lastname" runat="server" Width="353px" BorderStyle="Solid"></asp:TextBox>
    </p>
    <p align=center>
        Username&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        <asp:TextBox ID="txt_username" runat="server" Width="354px" BorderStyle="Solid"></asp:TextBox>
    </p>
    <p align=center>
        Password&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        <asp:TextBox ID="txt_password" runat="server" Width="361px" BorderStyle="Solid" 
            style="margin-left: 0px" TextMode="Password"></asp:TextBox>
    </p>
    <p align=center>
        &nbsp;&nbsp;&nbsp;&nbsp; Gender&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        <asp:RadioButton ID="btn_male" runat="server" BorderColor="Red" 
            GroupName="gender" />
        Male&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        <asp:RadioButton ID="btn_female" runat="server" BorderColor="Red" 
            GroupName="gender" />
        Female</p>
    <p align=center>
        Profile Picture &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
        <asp:FileUpload ID="FileUpload1" runat="server" Height="34px" Width="258px" 
            style="margin-left: 0px" />
    </p>
    <p align=center>
        <asp:Button ID="btn_register" runat="server" Text="Register" Width="180px" 
            BackColor="#FF5BAD" BorderStyle="Solid" Height="37px" />
    </p>
    </form>
</body>
</html>

                    Register.aspx.cs

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace using_standard_control
{
    public partial class REGISTER : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void btn_register_Click(object sender, EventArgs e)
        {
            ///////////////////code for uploading images/////////////////
            if (FileUpload1.HasFile)
            {
                FileUpload1.SaveAs("D:"+ FileUpload1.FileName.ToString());
            }
            else
            {
               label_fileupload.Text= "Please Browse the file first.....";
            }
        }
        
    }

}



No comments:

Post a Comment