Simple User Registration Demo with help of asp.net standard controls

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

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

        }

        protected void btnsave_Click(object sender, EventArgs e)
        {
            string UserName = "";
            string UserGender = "";
            string UserDateOfBirth = "";
            string hobbies = "";

            UserName = txtUserName.Text;
            UserGender = rbGender.SelectedValue;
            UserDateOfBirth = txtDateOfBirth.Text;

            for (int i = 0; i < chkhobbies.Items.Count; i++)
            {
                if (chkhobbies.Items[i].Selected)
                {
                    hobbies += chkhobbies.Items[i].Value + ",";
                }
            }
            lblname.Text = UserName.ToString();
            lblGender.Text = UserGender.ToString();
            lblDateOfBirth.Text = UserDateOfBirth.ToString();
            lblhobbies.Text = hobbies.ToString();

        }
    }
}






Comments

Popular posts from this blog

Asp.Net Validation

Fundamental of OOPS From Scratch to End