Jquery Ui在我的内容页面中没有工作

时间:2017-12-26 18:40:15

标签: jquery asp.net

jQuery UI不起作用,但在其他单独的网络表单中正常工作。

这是我的代码:

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1"  runat="server">
      <script type="text/javascript" src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta.2/js/bootstrap.bundle.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta.2/js/bootstrap.min.js"></script>
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta.2/css/bootstrap.min.css" rel="stylesheet" />

这是来自jQuery UI对话框的脚本,用于显示电子邮件正文:

<script type="text/javascript">
 $("[id*=lnkView]").live("click", function () {
    var subject = $(this).text();
    var row = $(this).closest("tr");
    $("#body").html($(".body", row).html());
    $("#attachments").html($(".Attachments", row).html());
    $("#dialog").dialog({
        title: subject,
        buttons: {
            Ok: function () {
                $(this).dialog('close');
            }
        }
    });
    return false;
});

  <div id="page-wrapper" class="gray-bg dashbard-1">
    <div class="content-top">
        <asp:GridView ID="gvEmails" runat="server" OnRowDataBound="OnRowDataBound" DataKeyNames="MessageNumber"
            AutoGenerateColumns="False" PagerSettings-Mode="NextPreviousFirstLast" BackColor="White" BorderColor="#CCCCCC" BorderStyle="None" BorderWidth="1px" CellPadding="3">
            <Columns>
                <asp:BoundField HeaderText="From" DataField="From" HtmlEncode="false" />
                <asp:TemplateField HeaderText="Subject">
                    <ItemTemplate>
                        <asp:LinkButton ID="lnkView" runat="server" Text='<%# Eval("Subject") %>' />
                        <span class="body" style="display: none; width: auto">
                            <%# Eval("Body") %></span>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:BoundField HeaderText="Date" DataField="DateSent" />
                <asp:TemplateField HeaderText="Attachment" ItemStyle-CssClass="Attachments">
                    <ItemTemplate>
                        <asp:Repeater ID="rptAttachments" runat="server">
                            <ItemTemplate>
                                <asp:LinkButton ID="lnkAttachment" runat="server" OnClick="Download" Text='<%# Eval("FileName") %>' />
                            </ItemTemplate>
                            <SeparatorTemplate>
                                <br>
                            </SeparatorTemplate>
                        </asp:Repeater>
                    </ItemTemplate>
                    <ItemStyle CssClass="Attachments"></ItemStyle>
                </asp:TemplateField>
            </Columns>
            <FooterStyle BackColor="White" ForeColor="#000066" />
            <HeaderStyle BackColor="#006699" Font-Bold="True" ForeColor="White" />
            <PagerStyle BackColor="White" ForeColor="#000066" HorizontalAlign="Left" />
            <RowStyle ForeColor="#000066" />
            <SelectedRowStyle BackColor="#669999" Font-Bold="True" ForeColor="White" />
            <SortedAscendingCellStyle BackColor="#F1F1F1" />
            <SortedAscendingHeaderStyle BackColor="#007DBB" />
            <SortedDescendingCellStyle BackColor="#CAC9C9" />
            <SortedDescendingHeaderStyle BackColor="#00547E" />
        </asp:GridView>
    </div>

这是我的Gmail帐户显示邮件的代码。我创建了Jquery UI对话框,用于显示邮件正文和附件。

1 个答案:

答案 0 :(得分:0)

我认为您忘记包含查询和查询ui脚本(通过script标记)。