Empowering The World Through Technology

ASP.NET User Creation Module in Visual Studio 2010

0 244

ASP.NET User Creation Module in Visual Studio 2010. Here is Complete Coding for the page of USER CREATION Module in Asp.net 2019. In user Creation Menu we can create a menu in asp.net through which an organization can allocate a User ID and Password for their employees.

Through this Menu an employee will be able to login their specific profile and manage their function and assignment, Online attendance of employees.

ASP.NET User Creation Module in Visual Studio 2010 User Creation Option
User Creation Option

How To Create User Creation option in ASP.NET 2010.

Designing Side Code For User Creation Page in asp.net

<table align=”center”>
       <tr>
         <td style=”text-align: right; width: 275px; height: 48px;”></td>
         <td style=”width: 366px; height: 48px;”>
<font><strong></strong> <asp:Label id=”Label4″ runat=”server” Visible=”False” class=”btn btn-primary” style=”text-align: left; font-weight: 700;” Width=”317px” Height=”28px”>Label</asp:Label><strong><asp:HyperLink id=”HyperLink1″ runat=”server” ToolTip=”Admin Options Page”    NavigateUrl=”AdminOptions.aspx” align=”left” ></asp:HyperLink></strong></font></td></tr>

<tr>
     <td style=”text-align: right; width: 275px <asp:Label id=”Label1″ runat=”server” Height=”20px”  Width=”100px” Font-Bold=”True” Font-Names=”Times New Roman” Font-Size=”11pt”>User Id</asp:Label> : </td>

   <td style=”width: 366px”>   <asp:DropDownList id=”DropDownList1″ class=”controls” data-rel=”chosen” runat=”server” Height=”30px” Width=”210px”                            onselectedindexchanged=”DropDownList1_SelectedIndexChanged”></asp:DropDownList>

<asp:Label id=”Label3″ runat=”server” Visible=”False”>Label</asp:Label></td>    </tr>    <tr>   <td style=”text-align: right; width: 275px <asp:Label id=”Label2″ runat=”server” Font-Bold=”True”   Font-Names=”Times New Roman” Font-Size=”11pt” >Password</asp:Label> : </td>

<td style=”width: 366px”>   <asp:TextBox id=”TextBox2″ runat=”server” TextMode=”Password” MaxLength=”8″ Height=”25px” Width=”200px” data-rel=”popover” data-content=”Enter password for User Creation. ”  title=”Password”></asp:TextBox>

<asp:RequiredFieldValidator id=”RequiredFieldValidator1″ runat=”server” ErrorMessage=”*” ControlToValidate=”TextBox2″></asp:RequiredFieldValidator></td> </tr>

  <tr><td style=”text-align: right; width: 275px” ><asp:Label id=”Label5″ runat=”server” Font-Bold=”True” Font-Names=”Times New Roman” Font-Size=”11pt” >Conform PassWord</asp:Label> : </td>

<td style=”width: 366px”>   <asp:TextBox id=”TextBox1″ runat=”server” TextMode=”Password” MaxLength=”8″   Height=”25px” Width=”200px” ></asp:TextBox> <asp:CompareValidator id=”CompareValidator1″ runat=”server” ControlToValidate=”TextBox2″ ErrorMessage=”*” ControlToCompare=”TextBox1″></asp:CompareValidator></td>                        </tr>

<tr><td style=”text-align: right; width: 275px”></td><td style=”width: 366px”><asp:Button id=”Button1″ runat=”server” Text=”Create” class=”btn btn-primary” onclick=”Button1_Click” Width=”100px”></asp:Button>

<asp:Button id=”Button2″ runat=”server” class=”btn btn-primary” Text=”Cancel”   onclick=”Button2_Click” Width=”100px”></asp:Button> </td> </tr>
</table>

User Creation Module Complete Coding Side File.

Complete Coding File for USER CREATION MODULE.
Here is complete coding for backend file like How to insert data into database?, How to setup successful login for employee, How to setup Employee Login and Log Out time.

using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
using System.Data.SqlClient;

public partial class admin_EmployeeUserCreation : System.Web.UI.Page
{
SqlConnection con = new SqlConnection(System.Configuration.ConfigurationManager.ConnectionStrings[“con_str”].ConnectionString);
    protected void Page_Load(object sender, System.EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            con.Open();
           SqlCommand cmd = new SqlCommand(“select EmployeeId from
mployee”);
            cmd.Connection = con;
            SqlDataReader dr;
            dr = cmd.ExecuteReader();
            DropDownList1.Items.Add(“Select”);
            while (dr.Read())
            {
               DropDownList1.Items.Add(Convert.ToString(dr[0]));
           }            con.Close();
        }
    }

    protected void Button1_Click(object sender, System.EventArgs e)
    {
        string userid = DropDownList1.SelectedItem.Text;
        string utype = “N”;
        if (userid == “Select”)
        {
            Label3.Text = “Select User Id”;
            Label3.Visible = true;
        }
        else
        {
            con.Open();
            SqlCommand cmd = new SqlCommand();
            cmd.CommandText = “select count(*) from EmployeeLogin where
UserId='” + userid + “‘”;
            cmd.Connection = con;
            if (Convert.ToInt32(cmd.ExecuteScalar()) == 0)
            {
                cmd.CommandText = “insert into EmployeeLogin values(‘” + userid + “‘ , ‘” + TextBox2.Text + “‘, ‘” + utype + “‘)”;

                cmd.Connection = con;
                cmd.ExecuteNonQuery();
                Label4.Text = “<h3>User ID Created Successfully….!</h3>”;
                Label4.Visible = true;
                con.Close();
                TextBox2.Text = “”;
            }
            else
          {
                Label4.Text = “<h3>User ID Already Exists….!</h3>”;
                Label4.Visible = true;
            }
        }
    }

    protected void Button2_Click(object sender, System.EventArgs e)
    {
        Response.Redirect(“Employeeusercreation.aspx”);
    }
   protected void DropDownList1_SelectedIndexChanged(object sender,
System.EventArgs e)
    {

    }
}

  1. Employee Registration form | Creation of Registration form in visual studio using c# and asp.net
  2. How to create a Recruitment or job announcement page in asp.net | Complete front end designing and backend coding
  3. How add new webpage in a website using C#, asp.net in visual studio.
  4. How to create login page using asp.net and C#
  5. How to Deal with Textbox and Radio Buttons in Java.
  6. How to implements Item Listener in java Frams
  7. How to create menu and menu items in java

Leave A Reply

Your email address will not be published.