我读过其他名称相似的帖子,但他们的问题都没有与我的匹配,他们的解决方案也没有解决我的问题。我有一个带有显示模式(ish)框的链接按钮字段的网格视图。因为链接按钮字段调用服务器端而不是客户端,所以我无法让 JQUERY 模式表单工作。相反,在链接按钮单击时,我会显示一个带有 CSS 的 asp 面板,使其看起来像模态(ish)。在该面板中,我有一个 asp 按钮,用于通过设置 panel.visible = false 来退出模式。
但是,当我单击“退出”按钮时,它永远不会调用隐藏面板的 btnExitProject_Click 子过程。通常在 Visual Studio 的设计模式下,我可以双击一个按钮,它会在服务器端代码中显示“onClick”事件;然而,现在它把我带到了 page_load 子。我不确定发生了什么事。页面上的其他按钮,在面板之外工作得很好,调用 jquery 函数的“加入项目”按钮(见图)也工作得很好。
<asp:Panel ID="pnlProjectInfo" runat="server" Visible="false">
<div class="overlay"></div>
<div class ="projectPanel">
<span class="spanStyle">Project Code: </span><asp:Label ID="lblProjectCode" runat="server" Text="[proj code]" CssClass="lblStyle1"></asp:Label><br /><br />
<span class="spanStyle">Entry Date: </span><asp:Label ID="lblEntryDate" runat="server" CssClass="lblStyle1"></asp:Label><br /><br />
<span class="spanStyle">Project: </span><br />
<asp:TextBox ID="tbProject" runat="server" Width="500px" CssClass="tbStyle1"></asp:TextBox><br />
<span class="spanStyle">Organization: </span><br />
<asp:TextBox ID="tbOrgName" runat="server" Width="395px" CssClass="tbStyle1" Enabled="false"></asp:TextBox><br />
<span class="spanStyle">Project Leader: </span><br /><asp:TextBox ID="tbProjLeader" runat="server" Width="196px" CssClass="tbStyle1"></asp:TextBox><br />
<span class="spanStyle">Description: </span><br /><asp:TextBox ID="tbDescription" runat="server"
Height="50px" Width="500px" TextMode="MultiLine" CssClass="tbStyle1"></asp:TextBox><br />
<span class="spanStyle">Comment: </span><br /><asp:TextBox ID="tbComment" runat="server"
Height="50px" Width="500px" TextMode="MultiLine" CssClass="tbStyle1"></asp:TextBox><br />
<br />
<span class="spanStyle">Project Members: </span>
<br />
<asp:GridView ID="gvProjectMembers" runat="server" AutoGenerateColumns="False"
CellPadding="3"
Width="512px" Font-Names="Arial" GridLines="Vertical" BackColor="White"
BorderColor="#333333" BorderStyle="Solid" BorderWidth="1px"
CssClass="projMembersGV">
<RowStyle BackColor="#ecf1ef" ForeColor="Black" HorizontalAlign="Center"
VerticalAlign="Top" />
<Columns>
<asp:BoundField DataField="individual_first_name" HeaderText="First Name" />
<asp:BoundField DataField="individual_last_name" HeaderText="Last Name" />
<asp:BoundField DataField="percentage_effort" HeaderText="Effort" />
<asp:BoundField DataField="participation_description"
HeaderText="Participation" />
<asp:BoundField DataField="active_indicator" HeaderText="Active" />
<asp:CommandField ButtonType="Button" ShowEditButton="True" />
</Columns>
<FooterStyle BackColor="#CCCCCC" ForeColor="Black" />
<PagerStyle BackColor="#999999" ForeColor="Black" HorizontalAlign="Center" />
<EmptyDataTemplate>
No members assinged to this project in the database.
</EmptyDataTemplate>
<SelectedRowStyle BackColor="#008A8C" Font-Bold="True" ForeColor="White" />
<HeaderStyle BackColor="#333333" Font-Bold="True" ForeColor="White" />
<AlternatingRowStyle BackColor="#ecf1ef" />
</asp:GridView>
<br />
<button id="create-user" type="button">Join Project</button> <!-- displays a jquery modal -->
<asp:Button ID="btnExitProject" runat="server" Text="Close" CssClass="btnClose" CausesValidation="false" Enabled="true" />
</div>
</asp:Panel>
这是面板的外观: