protected void res_Click(object sender, EventArgs e)
        {
            if ((string)Session["OTP"] != otp.Text || otp.Text == null)
            {
                Response.Redirect("~/register.aspx?msg=Wrong+OTP");
            }
            DatabaseEntities db = new DatabaseEntities();
            User             u  = new User();

            u.fname = fname.Text;
            u.mname = mname.Text;
            u.lname = lname.Text;

            u.mobile = mobile.Text;
            u.email  = email.Text;
            string date = dob.Text;
            int    day  = Int32.Parse(date.Substring(0, 2));
            int    mon  = Int32.Parse(date.Substring(3, 2));
            int    year = Int32.Parse(date.Substring(6, 4));

            u.dob          = new DateTime(year, mon, day);
            u.bid          = Int32.Parse(branch.SelectedValue);
            u.rollno       = rollno.Text;
            u.cpi          = Double.Parse(cpi.Text);
            u.backlog      = backlog.SelectedValue;
            u.batch        = batch.SelectedValue;
            u.security_q_a = que.SelectedValue + "_" + ans.Text;
            u.password     = pwd.Text;
            DateTime d       = DateTime.Now;
            int      prev_id = (int)Application["prev_id"];

            prev_id++;
            string id = prev_id.ToString();

            id = id.PadLeft(4, '0');
            Response.Write("id is : " + id + "\n");
            u.role   = "student";
            u.active = "yes";
            u.uuid   = u.batch + branch.SelectedItem.Text + id;
            if (image.HasFile)
            {
                try
                {
                    string filename = u.uuid + ".jpg";
                    image.SaveAs(Server.MapPath("~/Images/") + filename);
                    //Response.Write("Upload status: File uploaded!");
                    u.imageurl = Server.MapPath("~/Images/") + filename;
                    /* ~/Images/userid.jpg */
                }
                catch (Exception ex)
                {
                    // Response.Write("Upload status: The file could not be uploaded. The following error occured: " + ex.Message);
                }
            }
            else
            {
                try
                {
                    string filename = u.uuid + ".jpg";
                    File.Copy(Server.MapPath("~/Images/Default.png"), Server.MapPath("~/Images/") + filename);
                    // image.SaveAs(Server.MapPath("~/Images/") + filename);
                    //Response.Write("Upload status: File uploaded!");
                    u.imageurl = Server.MapPath("~/Images/") + filename;
                    /* ~/Images/userid.jpg */
                }
                catch (Exception ex)
                {
                    // Response.Write("Upload status: The file could not be uploaded. The following error occured: " + ex.Message);
                }
            }

            // Response.Write(u.security_q_a + "\n");
            // Response.Write(u.uuid + "\n");

            db.Users.Add(u);
            db.SaveChanges();
            sendmail("Successfully registered", "Please remeber your user id : " + u.uuid);
            Response.Redirect("~/index.aspx?msg=Your+user+ID+is+" + u.uuid + "+Please+remeber+it.");
        }