public IActionResult Getcourse() { List <Dcourse> temp = new List <Dcourse>(); Dcourse school1 = new Dcourse(); school1.ID = 1; school1.Name = "OOAD"; return(Json(temp)); }
protected void Page_Load(object sender, EventArgs e) { /*if (Session["UID"] == null) * { * Response.Redirect("../error_404_2.html"); * return; * } * if (Session["instID"].ToString() == null) * { * Response.Redirect("../error_404_2.html"); * } * if (Session["sesnID"].ToString() == null) * { * Response.Redirect("../error_404_2.html"); * }*/ try { BranchDivL.Visible = false; Course_Label.Visible = false; Subject_Label.Visible = false; Gender_Label.Visible = false; if (!IsPostBack) { BranchDiv.Visible = false; Dcourse.Items.Insert(0, "---Select Course---"); Dsubject.Items.Insert(0, "---Select Area of intrest---"); Dbranch.Items.Insert(0, "---Select Specialization---"); objFunc.FillDropdownlist(Dcourse, "Course", "Id", "SELECT Course,Id FROM (select id,Course,row_number() over(partition by course order by id ) as rn from inst1_details)t where rn=1 ", "---Select Course---"); Dcourse.Focus(); } if (IsPostBack) { conn.Open(); string checkUser = "******" + TextBox_EmailId.Text + "'"; SqlCommand com = new SqlCommand(checkUser, conn); int temp = Convert.ToInt32(com.ExecuteScalar().ToString()); conn.Close(); if (temp == 1) { objfun.MsgBox("Email Id Already exists...", this); } } } catch (Exception ex) { //Response.Redirect("../error_404_2.html"); throw ex; } finally { conn.Close(); } }