これが私がやろうとしていることです。ドロップダウンから値を選択し、そのページに移動してポストバックします。
1.aspx ページ
<asp:ListItem>a</asp:ListItem>
<asp:ListItem>b</asp:ListItem>
<asp:ListItem>c</asp:ListItem>
<asp:ListItem>d</asp:ListItem>
</asp:DropDownList>
Csfile:
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
DropDownList1.Enabled = true;
}
else
{
DropDownList1.Enabled = false;
DropDownList1.Attributes.Add("disable", "disable");
if (this.Session["Template"] == "a ")
{
this.DropDownList1.Attributes.Add("disable", "disable");
}
}
protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e)
{
if (DropDownList1.SelectedValue == "a")
{
Response.Redirect("~/a.aspx");
DropDownList1.Attributes.Add("disable", "disable");
}
ページ a.aspx にリダイレクトするオプション「a」を選択すると、詳細を入力した後、ページ 1.aspx に戻ります。
ここでは、ドロップダウンを無効にして、ユーザーがその特定のドロップダウンから再選択できないようにします。上記のオプションをすべて試しましたが、何も機能しませんでした。