【问题标题】:Modal popup not working in IE but Instead it displays as gridview using VB.net模态弹出窗口在 IE 中不起作用,而是使用 VB.net 显示为 gridview
【发布时间】:2015-12-22 00:50:36
【问题描述】:

Modal Popup 在 VB.net 程序中不起作用,而是在 IE 中显示为 gridview 以及一些不正确的对齐方式。

下面是asp.net中Modal弹窗的HTML脚本

HTML:

<asp:HiddenField ID="hfHidden" runat="server" />
                    <asp:ScriptManager ID="ScriptManager1" runat="server" />
                    <asp:Panel ID="pnlAllocationHistoryDetails" runat="server" Width="100%" Style="display: none;"
                        CssClass="TextVerdanaNavy8" HorizontalAlign="Center" Height="250px" ScrollBars="Vertical">
                        <table cellpadding="2" cellspacing="1" class="TextVerdanaNavy8" width="100%">
                            <tr>
                                <td style="width: 100%; height: 5%" align="center">
                                    <asp:LinkButton ID="lnkbtnPaidsofarDetailsClose" Font-Bold="true" BackColor="Transparent"
                                        ForeColor="DarkOrange" ToolTip="Close" Text="Close" runat="server"></asp:LinkButton>
                                </td>
                            </tr>
                            <tr>
                                <td align="center" style="width: 100%; height: 5%">
                                    <asp:GridView ID="gridAllocatedBillDetails" runat="server" AutoGenerateColumns="False"
                                        BorderColor="#999999" HorizontalAlign="Center" BorderStyle="None" BorderWidth="1px"
                                        CellPadding="3" CssClass="TextVerdanaNavy8" GridLines="Vertical" ShowFooter="True"
                                        Visible="True" AllowPaging="False" Width="50%">
                                        <FooterStyle BackColor="#CCCCCC" ForeColor="Black" />
                                        <RowStyle BackColor="#EEEEEE" ForeColor="Black" />
                                        <SelectedRowStyle BackColor="#008A8C" Font-Bold="True" ForeColor="White" />
                                        <PagerStyle BackColor="#999999" ForeColor="Black" HorizontalAlign="Center" Font-Size="Small" />
                                        <HeaderStyle BackColor="#000084" Font-Bold="True" ForeColor="White" />
                                        <AlternatingRowStyle BackColor="Gainsboro" />
                                        <Columns>
                                            <asp:BoundField DataField="DWMBL_WO_Number" HeaderText="Work Order Number">
                                                <ItemStyle HorizontalAlign="left" Width="15%" />
                                                <HeaderStyle HorizontalAlign="Center" />
                                            </asp:BoundField>
                                            <asp:BoundField DataField="DWMBL_Bill_Number" HeaderText="Bill Number">
                                                <ItemStyle HorizontalAlign="left" Width="15%" />
                                                <HeaderStyle HorizontalAlign="Center" />
                                            </asp:BoundField>
                                            <asp:BoundField DataField="DWMBL_Job_Code" HeaderText="Job/Dept Code" FooterText="Total ">
                                                <ItemStyle HorizontalAlign="left" Width="15%" />
                                                <HeaderStyle HorizontalAlign="Center" />
                                                <FooterStyle HorizontalAlign="Right" Font-Bold="true" />
                                            </asp:BoundField>
                                            <asp:BoundField DataField="DWMBL_Amount" HeaderText="Amount">
                                                <ItemStyle CssClass="TextVerdanaNavy8" HorizontalAlign="Right" Width="10%" />
                                                <HeaderStyle HorizontalAlign="Center" />
                                                <FooterStyle HorizontalAlign="Right" Font-Bold="true" />
                                            </asp:BoundField>
                                        </Columns>
                                    </asp:GridView>
                                </td>
                            </tr>
                            <tr>
                                <td style="width: 100%; height: 5%">
                                    &nbsp;
                                </td>
                            </tr>
                        </table>
                    </asp:Panel>

                    <cc2:ModalPopupExtender ID="AllocatedDetailsPopup" BehaviorID="pnlAllocationHistoryDetails" runat="server" TargetControlID="hfHidden"
                        PopupControlID="pnlAllocationHistoryDetails" CancelControlID="lnkbtnPaidsofarDetailsClose"
                        BackgroundCssClass="modalBackground">
                    </cc2:ModalPopupExtender>

下面是模态显示/隐藏的VB程序。

VB 编码:

'Show modal popup for Allocated so far details
    Protected Sub gridPolicyDetailsView_ItemCommand(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.DetailsViewCommandEventArgs) Handles gridPolicyDetailsView.ItemCommand
        If e.CommandName = "View" Then
            AllocatedDetailsPopup.Show()
        End If
    End Sub

    'Modal Popup hide for Allocated so far details
    Protected Sub lnkbtnPaidsofarDetailsClose_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles lnkbtnPaidsofarDetailsClose.Click
        AllocatedDetailsPopup.Hide()
    End Sub

任何类似 HTML/VB 脚本 的问题。 请建议...

【问题讨论】:

  • 请提出您的建议...

标签: html asp.net vb.net internet-explorer gridview


【解决方案1】:

您是否尝试过使用 javascript 来调用模式而不是后面的代码?

有点像

function showmodalpopup() {
            $("#AllocatedDetailsPopup").dialog({
            })

【讨论】:

  • 我也尝试过,但显示相同。 @PipecockJackson
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2012-09-29
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多