我已经使用Masterpage完成了多个Webforms应用程序,但是从未尝试过。 当我的菜单按钮位于母版页的div内时(如下图所示),它们不起作用,但是当它位于div之外时,则起作用。有人可以告诉我我在做什么错吗?
第一部分无效,而第二部分有效。
<form id="form1" runat="server">
<div runat="server" class="header">
<h1>SomeThing SomeThing</h1>
</div>
<div runat="server" class="menu">
<asp:Button ID="BtnHome" runat="server" Text="Home" OnClick="BtnHome_Click" />
<asp:Button ID="BtnBestyrelsen" runat="server" Text="Bestyrelsen" />
</div>
<div>
<asp:ContentPlaceHolder ID="ContentPlaceHolder1" runat="server">
</asp:ContentPlaceHolder>
</div>
</form>
EKS 2
<form id="form1" runat="server">
<asp:Button ID="BtnHome" runat="server" Text="Home" OnClick="BtnHome_Click" />
<div runat="server" class="header">
<h1>SomeThing SomeThing</h1>
</div>
<div runat="server" class="menu">
<asp:Button ID="BtnBestyrelsen" runat="server" Text="Bestyrelsen" />
</div>
<div>
<asp:ContentPlaceHolder ID="ContentPlaceHolder1" runat="server">
</asp:ContentPlaceHolder>
</div>
</form>