Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: jQuery
I am getting error in Jquery as 'null' or not an object.
 
I have declared the div tag values in jquery. but, still it is getting null object.
 
see my code below.
 
Master Page
-----------
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
 
    <link type="text/css" rel="Stylesheet" href="Styles/Home.css" />
 
    <asp:ContentPlaceHolder ID="paneContentPlace" runat="server">
 

    </asp:ContentPlaceHolder>
 
</head>
 

ASPX Page
-------------
 
<asp:Content ID="Content3" ContentPlaceHolderID="paneContentPlace" runat="Server">
 
        <script language="javascript" type="text/javascript">
            $(document).ready(function () {
                $("div.ContainerPanel").toggle(   /*********** Error Place ('null' or not null object)******/
                function () {
                    $(this).parent().next("div.Content").show("slow");
                    $(this).attr("class", "ArrowClose");
                });
                alert("Hello Word");
 
            });
        </script>
 
        <style type="text/css">
        .ContainerPanel
{
 width:400px;
 border:1px;
 border-color:#1052a0;
 border-style:double double double double;
}
.collapsePanelHeader
{
    width: 400px;
    height: 30px;
    background-image: url('../images/bg-menu-main.png');
    background-repeat: repeat-x;
    color: #FFF;
    font-weight: bold;
}
.HeaderContent
{
 float:left;
 padding-left:5px;
}
.Content
{
 
}
.ArrowExpand
{
    background-image: url('../images/expand_blue.jpg');
    width: 13px;
    height: 13px;
    float: right;
    margin-top: 7px;
    margin-right: 5px;
}
.ArrowExpand:hover
{
 cursor:hand;
}
.ArrowClose
{
    background-image: url('../images/collapse_blue.jpg');
    width: 13px;
    height: 13px;
    float: right;
    margin-top: 7px;
    margin-right: 5px;
}
.ArrowClose:hover
{
 cursor:hand;
}
 
</style>
 
</asp:Content>
  <asp:UpdatePanel ID="upnl1" runat="server">
        <ContentTemplate>
  <div>
                <div id="ContainerPanel" class="ContainerPanel">
                    <div id="header" class="collapsePanelHeader">
                        <div id="dvHeaderText" class="HeaderContent">
                            jQuery Collapsible Panel1</div>
                        <div id="dvArrow" class="ArrowExpand">
                        </div>
                    </div>
                    <div id="dvContent" class="Content" style="display: none">
                        In Album List Page, we will display 3 albums in a row in Tiled format i.e. to repeat
                        In our case, it is LastItem.
                    </div>
                </div>
                <br />
                <div id="Div1" class="ContainerPanel">
                    <div id="Div2" class="collapsePanelHeader">
                        <div id="Div11" class="HeaderContent">
                            jQuery Collapsible Panel2</div>
                        <div id="Div3" class="ArrowExpand">
                        </div>
                    </div>
                    <div class="Content" style="display: none">
                        Test
                    </div>
                </div>
</div>
     </ContentTemplate>
    </asp:UpdatePanel>
Posted 22-Mar-13 1:15am
gani77871.3K
Edited 22-Mar-13 1:23am
v2
Comments
Shubhashish_Mandal at 22-Mar-13 7:59am
   
In which explorer you have got this error?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 Sergey Alexandrovich Kryukov 535
1 OriginalGriff 275
2 BillWoodruff 260
3 Shweta N Mishra 244
4 Deepu S Nair 230
0 OriginalGriff 6,168
1 Sergey Alexandrovich Kryukov 5,818
2 DamithSL 4,958
3 Manas Bhardwaj 4,539
4 Maciej Los 3,755


Advertise | Privacy | Mobile
Web02 | 2.8.1411019.1 | Last Updated 22 Mar 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100