我想根据 ddlCat 和 ddlSubCat(Dropdownlist) 的选择将“Manage-Cat-Subcat.aspx”从“Mainpage.aspx”重定向到显示 panel1 和 panel2...
重定向到“Manage-Cat-Subcat.aspx”页面以显示Panel1:
protected void ddlcat_SelectedIndexChanged(object sender, EventArgs e)
{
if (ddlcat.SelectedItem.Text == "Other...")
{
Response.Redirect("ManageCat-SubCat.aspx?Register=pnlCat");
}
}
重定向到“Manage-Cat-Subcat.aspx”页面以显示Panel2:
protected void ddlsubcat_SelectedIndexChanged(object sender, EventArgs e)
{
if (ddlsubcat.SelectedItem.Text == "Other...")
{
Response.Redirect("ManageCat-SubCat.aspx?Register=pnlSubCat");
}
}
这就是我在 Manage-Cat_Subcat.aspx 中尝试根据“注册”中的值显示的内容
protected void Page_Load(object sender, EventArgs e)
{
if (Request.QueryString["Register"] = pnlCat)
{
Panel1.Visible = true;
}
else if (Request.QueryString["Register"] = pnlSubCat)
{
Panel2.Visible = true;
}
谢谢!!