troubleshooting Question

Object expected. $(window).bind('load', function () {

Avatar of omegalove
omegalove asked on
ASP.NET
3 Comments2 Solutions751 ViewsLast Modified:
div class="private-messages-box">
    <script type="text/javascript">

        $(window).bind('load', function () {
            var cbHeader = $(".cbHeaderPMInbox input");
            var cbRowItem = $(".cbRowItemPMInbox input");
            cbHeader.bind("click", function () {
                cbRowItem.each(function () { this.checked = cbHeader[0].checked; })
            });
            cbRowItem.bind("click", function () { if ($(this).checked == false) cbHeader[0].checked = false; });
        });
   
    </script>
    <div class="PrivateMessages">
        <div>

                  </div>
    </div>
    <div>
       
    </div>
    <div class="clear">
    </div>
    <div class="button">
       
       
    </div>
</div>

                   
            </div><div id="ctl00_ctl00_cph1_cph1_PrivateMessagesTabs_pnlPrivateMessagesSentItems" class="ajax__tab_panel" style="display:none;visibility:hidden;">
                  
                       
<div class="private-messages-box">


<script type="text/javascript">

    $(window).bind('load', function () {
        var cbHeader = $(".cbHeaderPMSent input");
        var cbRowItem = $(".cbRowItemPMSent input");
        cbHeader.bind("click", function () {
            cbRowItem.each(function () { this.checked = cbHeader[0].checked; })
        });
        cbRowItem.bind("click", function () { if ($(this).checked == false) cbHeader[0].checked = false; });
    });
   
</script>

<%@ Control Language="C#" AutoEventWireup="true" Inherits="OmegaLove.Web.UI.PrivateMessagesInbox"
    CodeBehind="PrivateMessagesInbox.ascx.cs" %>
<div class="private-messages-box">
    <script type="text/javascript">

        $(window).bind('load', function () {
            var cbHeader = $(".cbHeaderPMInbox input");
            var cbRowItem = $(".cbRowItemPMInbox input");
            cbHeader.bind("click", function () {
                cbRowItem.each(function () { this.checked = cbHeader[0].checked; })
            });
            cbRowItem.bind("click", function () { if ($(this).checked == false) cbHeader[0].checked = false; });
        });
    
    </script>
    <div class="PrivateMessages">
        <asp:GridView ID="gvInbox" DataKeyNames="PrivateMessageId" runat="server" AllowPaging="True"
            AutoGenerateColumns="False" CellPadding="4" DataSourceID="odsInbox" GridLines="None"
            PageSize="10" CssClass="pmgridtablestyle">
            <AlternatingRowStyle CssClass="pmgridaltrowstyle" />
            <HeaderStyle CssClass="pmgridheaderstyle" />
            <RowStyle CssClass="pmgridrowstyle" />
            <PagerStyle CssClass="pmgridpagerstyle" />
            <Columns>
                <asp:TemplateField ItemStyle-Width="5%" ItemStyle-HorizontalAlign="Center">
                    <HeaderTemplate>
                        <asp:CheckBox ID="cbSelectAll" runat="server" CssClass="cbHeaderPMInbox" />
                    </HeaderTemplate>
                    <ItemTemplate>
                        <asp:CheckBox ID="cbSelect" runat="server" CssClass="cbRowItemPMInbox" />
                        <asp:HiddenField ID="hfPrivateMessageId" runat="server" Value='<%# Eval("PrivateMessageID") %>' />
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="From"
                    ItemStyle-Width="20%">
                    <ItemTemplate>
                        <%#GetFromInfo(Convert.ToInt32(Eval("FromProfileID")))%>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Subject"
                    ItemStyle-Width="50%">
                    <ItemTemplate>
                        <%#GetSubjectInfo(Container.DataItem as PrivateMessage)%>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Date"
                    HeaderStyle-HorizontalAlign="Center" ItemStyle-Width="25%" ItemStyle-HorizontalAlign="Center">
                    <ItemTemplate>
                        <%#DateTimeHelper.ConvertToUserTime((DateTime)Eval("CreatedOn"), TimeZoneInfo.Utc).ToString()%>
                    </ItemTemplate>
                </asp:TemplateField>
            </Columns>
        </asp:GridView>
    </div>
    <div>
        <asp:ObjectDataSource ID="odsInbox" runat="server" SelectMethod="GetCurrentUserInboxPrivateMessages"
            EnablePaging="true" TypeName="OmegaLoveHelper" StartRowIndexParameterName="StartIndex"
            MaximumRowsParameterName="PageSize" SelectCountMethod="GetCurrentUserInboxPrivateMessagesCount">
        </asp:ObjectDataSource>
    </div>
    <div class="clear">
    </div>
    <div class="button">
        <asp:Button runat="server" ID="btnDeleteSelected" Text="Delete selected"
            ValidationGroup="InboxPrivateMessages" OnClick="btnDeleteSelected_Click" CssClass="deleteselectedpmbutton">
        </asp:Button>
        <asp:Button runat="server" ID="btnMarkAsUnread" Text="Mark selected as unread"
            ValidationGroup="InboxPrivateMessages" OnClick="btnMarkAsUnread_Click" CssClass="deleteselectedpmbutton">
        </asp:Button>
    </div>
</div>
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 2 Answers and 3 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 2 Answers and 3 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros