【问题标题】:Popup opening at bottom of page在页面底部打开弹出窗口
【发布时间】:2014-01-29 11:20:55
【问题描述】:

我的页面上有一个按钮,单击它时会显示错误列表(如果有)。

但是,如果在单击此按钮后,我想在单击另一个按钮时删除记录,则该按钮会在页面底部打开一个弹出窗口,并且不会正常显示。

它应该使屏幕变暗并在屏幕中间显示弹出窗口。

下面是第一个按钮的代码,如果需要,我会提供 asp。

Sub DisplayErrors()
    Dim i As Integer = 0
    If error_array Is Nothing Then
        'Response.Redirect("GlobalDBRoutine.aspx?text=" + QuoteNolbl.Text)
    Else
        'For i = 0 To error_array.Length - 1
        '    Dim Trow As New TableRow
        '    Dim Tcell As New TableCell()
        '    Tcell.Text = error_array(i).ToString
        '    Trow.Cells.Add(Tcell)
        '    Table2.Rows.Add(Trow)
        'Next
        Dim Newerror_array() = error_array.Distinct.ToArray
        For i = 0 To Newerror_array.Length - 1
            Dim Trow As New TableRow
            Dim Tcell As New TableCell()
            Tcell.Text = Newerror_array(i).ToString
            Trow.Cells.Add(Tcell)
            Table2.Rows.Add(Trow)
        Next
        MessageBox.Show(" There is a problem in estimation !!! Have a look at the bottom of the page to see if it says anything if not contact IT.")
    End If
End Sub

这是删除按钮以及我正在使用的 modalpopup 扩展器。

按钮:

            <asp:Button ID="cmdDelete" runat="server" Text="Delete" Width="80px" CssClass="ProdPlusCom"
                OnClientClick="Javascript:ShowPopup('DeletePopup'); " />
            <asp:ModalPopupExtender ID="cmdDelete_ModalPopupExtender" runat="server" DynamicServicePath=""
                Enabled="True" TargetControlID="cmdDelete" BackgroundCssClass="modalBackground"
                CancelControlID="cmdCancel" PopupControlID="DeletePopup">
            </asp:ModalPopupExtender>

弹出:

<div id="DeletePopup" class="modalPopup" style="font-family: Verdana; font-size: 10pt;
    width: 200px; height: auto; visibility: hidden">
    <asp:Label ID="lblWarn" runat="server" Text="Are You sure you want to delete this specification?"></asp:Label><br />
    <br />
    <asp:Button ID="cmdCommit" runat="server" CssClass="ProdPlusCom" Text="Ok" />
    <asp:Button ID="cmdCancel" runat="server" CssClass="ProdPlusCom" Text="Cancel" />
</div>

【问题讨论】:

  • MessageBox.Show 在 asp.net 中?

标签: javascript asp.net vb.net


【解决方案1】:

可能是css的错误。贴出modalPopup的css

假设您想确认用户的删除。您也可以使用 ajax 确认按钮扩展器。 ModalPopup 也是正确的,但请确保您提供的是 ModalPopu[

【讨论】:

  • CSS 与我在所有其他弹出扩展器中使用的相同。所以我知道这没有问题......我认为唯一可能的问题是它已经进行了更改并且没有回发。
猜你喜欢
  • 1970-01-01
  • 2014-07-04
  • 1970-01-01
  • 2012-04-30
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2012-06-03
相关资源
最近更新 更多