这是我的加载会话和保存会话值函数.如何选中保留所选值并使用它"跳过"某个页面?谢谢!
 protected override void LoadSessionValues()
    {
       if (Session["ddlClassification"] != null)
        {
            ddlClassification.SelectedValue = (String)Session["ddlClassification"];
        }
    }
  protected override void SaveSessionValues()
    {
        Session["ddlClassification"] = ddlClassification.SelectedValue;
    }
if (Session["ddlClassification"].ToString() == "valueToCheckFor")
{
Response.Redirect("page1.aspx", false);
}
else
{
Response.Redirect("page2.aspx", false);
}
从以下评论更新
在page1.aspx中
protected void Page_Load(object sender, EventArgs e)
{
    if (Session["ddlClassification"].ToString() == "valueToCheckFor" || Session["ddlClassification"] == null)
    {
    Response.Redirect("someOtherPage.aspx", false);
    }
}
| 归档时间: | 
 | 
| 查看次数: | 96 次 | 
| 最近记录: |