コード例 #1
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (Session["Role"].ToString() != "Admin")
     {
         Response.Redirect("../Anonymous/ErrorPage.aspx");
     }
     if (!Page.IsPostBack)
     {
         ObjectDataSource_Questions.SelectParameters["Crs_Id"].DefaultValue = ((Label)GridView1.Rows[0].Cells[0].FindControl("Label_Crs_Id")).Text;
         ObjectDataSource_Questions.Select();
     }
 }
コード例 #2
0
 protected void GridView1_SelectedIndexChanging(object sender, GridViewSelectEventArgs e)
 {
     ObjectDataSource_Questions.SelectParameters["Crs_Id"].DefaultValue = ((Label)GridView1.Rows[e.NewSelectedIndex].Cells[0].FindControl("Label_Crs_Id")).Text;
     ObjectDataSource_Questions.Select();
 }