if(!Page.IsPostBack)始终为false,在我单击链接按钮后页面加载,并且它从未进入链接按钮事件。急需帮助!我尽可能多地在谷歌上搜索。我对asp有点陌生
这是我在服务器中的代码:
protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{
SetDefaultView();
}
}
private void SetDefaultView()
{
MultiView1.ActiveViewIndex = 0;
}
protected void LinkButton1_Click(object sender, EventArgs e)
{
MultiView1.ActiveViewIndex = 0;
}
protected void LinkButton2_Click(object sender, EventArgs e)
{
MultiView1.ActiveViewIndex = 1;
}
//及以下。。
<td>
<asp:LinkButton ID="LinkButton1" runat="server"
onclick="LinkButton1_Click">Tab1</asp:LinkButton>
</td>
<td>
<asp:LinkButton ID="LinkButton2" runat="server" onclick="LinkButton2_Click">Tab2</asp:LinkButton>
</td>