protected void Page_Load(object sender, EventArgs e) { try { if (Convert.ToString(Server.HtmlEncode(Request.Cookies["MyLogin"]["PWD"])) == "") { Response.Redirect("../Login.aspx"); } else { if (!IsPostBack) { maikal dev = new maikal(); int se = dev.chksession(); if (se == 0) { ddlExamSeason.SelectedValue = "Sum"; } else { ddlExamSeason.SelectedValue = "Win"; } lblStreamHidden.Text = "Tech"; lblStreamName.Text = "Technician Engineering"; txtyear.Text = DateTime.Now.Year.ToString(); lblSeason.Text = ddlExamSeason.SelectedValue.ToString() + "" + txtyear.Text.ToString(); string qry = ""; ddlCourse.SelectedValue = "Civil"; if (ddlCourse.SelectedValue.ToString() == "Civil") { qry = "select Distinct CourseID from CivilSubMaster"; } else if (ddlCourse.SelectedValue.ToString() == "Architecture") { qry = "select Distinct CourseID from ArchiSubMaster"; } SqlDataAdapter ad = new SqlDataAdapter(qry, con); DataSet ds = new DataSet(); ad.Fill(ds); ddlSyllabus.DataSource = ds; ddlSyllabus.DataTextField = "CourseID"; ddlSyllabus.DataValueField = "CourseID"; ddlSyllabus.DataBind(); FeeMaster fm = new FeeMaster(); ddlSyllabus.SelectedValue = fm.currentCourse(ddlCourse.SelectedValue.ToString()); ddlType.Focus(); } } } catch (NullReferenceException ex) { Response.Redirect("../Login.aspx"); } }
protected void Page_Load(object sender, EventArgs e) { try { if (Convert.ToString(Server.HtmlEncode(Request.Cookies["MyLogin"]["PWD"])) == "") { Response.Redirect("../Login.aspx"); } else { if (!IsPostBack) { panelHidden.Visible = true; panelView.Visible = false; lblStreamCode.Text = "Tech"; lblStreamCode.Text = "Tech"; lblStreamName.Text = "Technician Engineering"; txtYear.Text = DateTime.Now.Year.ToString(); lblSeason.Text = ddlExamSeason.SelectedValue.ToString() + "" + txtYear.Text.ToString(); string qyry = ""; if (ddlCourse.SelectedValue.ToString() == "Civil") { qyry = "select distinct CourseID from CivilSubMaster"; } else if (ddlCourse.SelectedValue.ToString() == "Architecture") { qyry = "select distinct CourseID from ArchiSubMaster"; } SqlDataAdapter ad = new SqlDataAdapter(qyry, con); DataSet ds = new DataSet(); ad.Fill(ds); ddlSyllabus.DataSource = ds; ddlSyllabus.DataTextField = "CourseID"; ddlSyllabus.DataValueField = "CourseID"; ddlSyllabus.DataBind(); FeeMaster fm = new FeeMaster(); ddlSyllabus.SelectedValue = fm.currentCourse(ddlCourse.SelectedValue.ToString()); showcourse(); } // visisble.Visible = true; invisible.Visible = false; } } catch (NullReferenceException ex) { Response.Redirect("../Login.aspx"); } }