Пример #1
0
 protected void Page_Load(object sender, EventArgs e)
 {
     success.Visible  = false;
     nsuccess.Visible = false;
     fname.Focus();
     if (Page.IsPostBack == false)
     {
         clsregister obj             = new clsregister();
         List <clsregistrationprp> k = obj.find_rec(Convert.ToInt32(Session["regid"]));
         List <clsregistrationprp> p = obj.find_parent(Convert.ToInt32(Session["regid"]));
         if (k.Count > 0)
         {
             ViewState["regid"]  = k[0].regid;
             fname.Text          = k[0].f_name;
             lname.Text          = k[0].l_name;
             rollno.Text         = k[0].rollno;
             email.Text          = k[0].email;
             dob.Text            = k[0].dob;
             contact.Text        = k[0].contact;
             father.Text         = k[0].father;
             mother.Text         = k[0].mother;
             parent_contact.Text = p[0].parentcontact;
             parent_email.Text   = p[0].parentemail;
             address.Text        = k[0].address;
             department.Text     = k[0].dept;
             semester.Text       = k[0].sem;
             acc_type.Text       = k[0].acc_type;
             hostel.Text         = k[0].hostel;
             bus.Text            = k[0].bus;
             password.Text       = k[0].password;
             lastupd.Text        = k[0].lastupd;
         }
     }
 }
Пример #2
0
    protected void Page_Load(object sender, EventArgs e)
    {
        firstname.Focus();
        if (Page.IsPostBack == false)
        {
            string pID = Convert.ToString(Session["regid"]);

            clsregister obj             = new clsregister();
            List <clsregistrationprp> k = obj.find_rec(Convert.ToInt32(pID));
            List <clsregistrationprp> p = obj.find_parent(Convert.ToInt32(pID));

            if (k.Count > 0)
            {
                ViewState["regid"] = k[0].regid;
                firstname.Text     = k[0].f_name;
                lastname.Text      = k[0].l_name;
                rollno.Text        = k[0].rollno;
                emailaddress.Text  = k[0].email;
                dob.Text           = k[0].dob;
                contact.Text       = k[0].contact;
                father_name.Text   = k[0].father;
                mother_name.Text   = k[0].mother;
                address.Text       = k[0].address;
                parentcontact.Text = p[0].parentcontact;
                parentemail.Text   = p[0].parentemail;
                DropDownList4.SelectedItem.Text = k[0].dept;
                Sem.SelectedItem.Text           = k[0].sem;
                DropDownList3.SelectedItem.Text = k[0].acc_type;
                hostel.Text   = k[0].hostel;
                bus.Text      = k[0].bus;
                Password.Text = k[0].password;
                lstupd.Text   = k[0].lastupd;
            }
        }
        if (Convert.ToInt32(DropDownList3.SelectedItem.Value) == 2 || Convert.ToInt32(DropDownList3.SelectedItem.Value) == 3)
        {
            rollno.ReadOnly = false;
            Sem.Enabled     = true;
            // parent.ReadOnly = false
            parentcontact.ReadOnly = false;
            parentemail.ReadOnly   = false;
        }

        else
        {
            rollno.ReadOnly = true;
            Sem.Enabled     = false;
            //parent.ReadOnly = true;
            parentcontact.ReadOnly = true;
            parentemail.ReadOnly   = true;
        }
    }