Click here to Skip to main content
16,016,527 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
[NullReferenceException: Object reference not set to an instance of an object.]
DBAccess.setConnString() +77
DBAccess..ctor() +140
_Default..ctor() +49
ASP.default_aspx..ctor() in c:\Users\DELL\AppData\Local\Temp\Temporary ASP.NET Files\root\7b316ac0\74a3eae4\App_Web_default.aspx.cdcab7d2.marfntd9.0.cs:0
__ASP.FastObjectFactory_app_web_default_aspx_cdcab7d2_marfntd9.Create_ASP_default_aspx() in c:\Users\DELL\AppData\Local\Temp\Temporary ASP.NET Files\root\7b316ac0\74a3eae4\App_Web_default.aspx.cdcab7d2.marfntd9.1.cs:0
System.Web.Compilation.BuildResultCompiledType.CreateInstance() +30
System.Web.Compilation.BuildManager.CreateInstanceFromVirtualPath(VirtualPath virtualPath, Type requiredBaseType, HttpContext context, Boolean allowCrossApp) +100
System.Web.UI.PageHandlerFactory.GetHandlerHelper(HttpContext context, String requestType, VirtualPath virtualPath, String physicalPath) +31
System.Web.UI.PageHandlerFactory.GetHandler(HttpContext context, String requestType, String virtualPath, String path) +37
System.Web.MaterializeHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +346
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +155

my Default.aspx code:
C#
<%@ Page Title=" " Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" Inherits="_Default, App_Web_oscnz2mo" Culture="auto" UICulture="auto" meta:resourcekey="PageResource2" EnableViewStateMac="false" EnableEventValidation="false" ViewStateEncryptionMode="Never" %>

<%@ Register Src="Poll.ascx" TagName="Poll" TagPrefix="uc2" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <script type="text/javascript" src="js/preview2.js"></script>
    <script type="text/javascript" src="js/jquery.wt-scroller.min2.js"></script>
    <link rel="stylesheet" type="text/css" href="css/wt-scroller2.css" />
    <script src="http://widgets.twimg.com/j/2/widget.js"></script>
    <script type="text/javascript">
        $(document).ready(function () {

            $(".ColorIcon div").click(function (e) {
                $(".loading img").attr("src", "loading/" + $(this).attr('color') + ".gif");
            });

            $(".example7in").colorbox({ width: "650px", height: "410px", iframe: true });
            $(".example8in").colorbox({ width: "650px", height: "410px", iframe: true });

            $('.viewVideo').click(function () {
                $('.viewVideo').hide();
                $('#viewVideo2').hide();
                $('.loading img').show();

                $.get("Ajax.aspx", { job: "ViewVideo", videoName: $('.viewVideo').attr("videoName") },
            function (data) {

                $('#videoResult').html(data);
                $('.loading img').hide();
                $(".videHBG").hide();
            });

            });

            $(".homeNav").addClass("TColor");
        });

    </script>
    <script type="text/javascript">
        $(document).ready(function () {
            $(".home").each(function () {
                $(this).next(".fontStyle").stop().animate({ top: "25px", "opacity": "1" }, 500);
                $(this).addClass("home_hover").addClass("currentPageSelect");
                $(this).parent().removeAttr("href");
            });

        });

    </script>
    <div class="inpage">
        <div class="AboutFamily">
            <h2 class="TColor fontStyle SColor RDir RText FRight PRelative"><span class="HTitleIcon HomeIcon"></span>كلمة الأسرة...</h2>
            <p class="FRight fontStyle RDir RText FamilyWord" id="FamilyWord"  runat="server">
            </p>
        </div>
        <!--AboutFamily1!-->
        <div id="ShowTree"  runat="server" visible="false">
            <div class="Line1"></div>
            <a class="liveDemo FRight" href="Tree">
                <span class="TColor fontStyle">شاهد شجرة الأسرة الإلكترونية  ..</span>
                <span class="enter fontStyle">اضغط هنا</span>
            </a>
            <!--LiveDemo!-->
        </div>
        <div class="AboutFamily2 FRight">
            <h2 class="TColor fontStyle SColor RDir RText FRight PRelative"><span class="HTitleIcon HomeIcon"></span><a href="AboutUS" class="TColor">عن الأسرة...</a></h2>
            <p class="FRight fontStyle RDir RText" id="AboutFamily"  runat="server"></p>
        </div>
        <!--AboutFamily2!-->
        <div class="AboutFamily3 PRelative FRight">
            <h2 class="TColor fontStyle SColor RDir RText FRight PRelative"><span class="HTitleIcon HomeIcon"></span><a href="ViewAllNews-2" class="TColor">مناسبات...</a></h2>
            <p class="FRight fontStyle RDir RText" id="Occasions"  runat="server">
            </p>
            <%--<a href="ViewAllNews-2" class="more fontStyle">شاهد المزيد</a>--%>
        </div>
        <!--AboutFamily3!-->
        <div class="clear"></div>
        <div class="Line1"></div>
        <!--Line1!-->
        <div class="video_Home PRelative FRight">
            <h2 class="TColor fontStyle SColor RDir RText FRight PRelative"><span class="HTitleIcon HomeIcon"></span>مكتبة الفيديو..</h2>
            <div class="Video_H PRelative FRight clear" id="videoResult">
                <asp:Repeater ID="RpVideo" runat="server" OnItemDataBound="RpVideo_ItemDataBound">
                    <ItemTemplate>
                        <div class="PlyaIcon HomeIcon PRelative viewVideo" videoname='<%# Eval("VideoName")%>'></div>
                        <!--PlayIcon!-->
                        <div class="loading">
                            <asp:Literal ID="ltrVedioLoading" runat="server"></asp:Literal>
                        </div>
                        <asp:Image runat="server" ID="imgVideo" CssClass="viewVideo" Style="cursor: pointer" videoName='<%# Eval("VideoName")%>' Width="336" Height="209" />
                    </ItemTemplate>
                </asp:Repeater>
                <div class="videHBG"></div>
            </div>
            <a href="video-1" class="more fontStyle">شاهد المزيد
            </a>
        </div>
        <!--VeidoHome!-->
        <div class="Home_Song FRight PRelative">
            <h2 class="TColor fontStyle SColor RDir RText FRight PRelative"><span class="HTitleIcon HomeIcon"></span>مكتبة الصوتيات..</h2>
            <asp:Repeater ID="RpSong" runat="server">
                <ItemTemplate>
                    <div class="song_box PRelative">
                        <div class="song_no"></div>
                        <div class="song_title"><span class="Title fontStyle"><%#Eval("Name") %></span></div>
                        <a href="Files/Song/<%# Eval("SongName") %>" class="song_down HomeIcon"></a><span class="date"><%#Eval("Date","{0:dd-MM-yyyy}") %></span>
                        <div class="speaker"><a href="Files/Song/<%# Eval("SongName") %>" class="audio"></a></div>
                    </div>
                    <!--End of Song_Box!-->
                </ItemTemplate>
            </asp:Repeater>
            <a href="Song-1" class="more fontStyle">شاهد المزيد</a>
        </div>
        <!--SongHome!-->
        <div class="Line1"></div>
        <div class="HAlbum FRight PRelative">
            <h2 class="TColor fontStyle SColor RDir RText FRight PRelative"><span class="HTitleIcon HomeIcon"></span><a href="ImagesGallaryView-1" class="TColor">ألبوم الصور..</a></h2>
            <div class="container2 clear FLeft PRelative">
                <div class="wt-scroller2">
                    <div class="prev-btn HomeIcon"></div>
                    <div class="slides2">
                        <ul>
                            <asp:Repeater ID="RBImages" runat="server">
                                <ItemTemplate>
                                    <li>
                                        <a href="ImageDetails-<%# Eval("id") %>">
                                            <span style="width: 218px; float: right; removed: relative; height: 122px; background: removed(LargeImage?w=218&h=122&type=Gallery&image=Images/ImageGallary/<%#Eval("FileName") %>) no-repeat"></span>
                                            <img style="position: absolute; z-index: -10;" width="218" height="122" alt="<%#Eval("Title") %>" title="<%#Eval("Title") %>" />
                                        </a>
                                    </li>
                                </ItemTemplate>
                            </asp:Repeater>
                        </ul>
                    </div>
                    <div class="next-btn HomeIcon"></div>
                </div>
            </div>
        </div>
        <!--HomeAlbum!-->
        <div class="clear"></div>
        <div class="Line1"></div>
        <div class="con2 FRight PRelative">
            <div class="con21">
                <h2 class="TColor fontStyle SColor RDir RText FRight PRelative"><span class="HTitleIcon HomeIcon"></span>ذكرى ميلاد....</h2>
                <span class="date">
                    <asp:Label ID="DateNow" runat="server"></asp:Label>
                </span>
                <div class="fontStyle"  runat="server" style="background: none;" id="NoDOB" visible="false">
                    <%--<span style="float:right; removed:relative; width:306px; height:236px; background:removed(img/mm.png) no-repeat"></span>--%>
                </div>
                <asp:Literal ID="LtrFamilyTreeCurrentDOB" runat="server"></asp:Literal>
                <asp:Repeater ID="RpFamilyTreeNextDOB" runat="server">
                    <ItemTemplate>
                        <div class="fontStyle"><%#Eval("name")%>  <%#Eval("name1")%>  <%#Eval("name2")%> <span class="date"><%#Eval("DOB", "{0:dd-MM-yyyy}")%></span></div>
                    </ItemTemplate>
                </asp:Repeater>
            </div>
            <!--Remember!-->
            <div class="con22">
                <h2 class="TColor fontStyle SColor RDir RText FRight PRelative"><span class="HTitleIcon HomeIcon"></span>هذا الموقع برعاية..</h2>
                <asp:Repeater runat="server" ID="RpSponser">
                    <ItemTemplate>
                        <a href="<%#Eval("Link") %>" target="_blank">
                            <span style="width: 290px; height: 69px; float: right; removed: relative; background: removed(LargeImage?w=290&h=69&type=Sponser&image=Images/Postions/<%#Eval("FileName") %>) no-repeat;"></span>
                        </a>
                    </ItemTemplate>
                </asp:Repeater>
            </div>
            <div class="con23">
                <h2 class="TColor fontStyle SColor RDir RText FRight PRelative"><span class="HTitleIcon HomeIcon"></span>مقتطفات..</h2>
                <asp:Repeater runat="server" ID="RpMoq">
                    <ItemTemplate>
                        <div class="fontStyle">
                            <a href="<%# DA.GenerateURL("NewsDetails",Eval("SEOEngName"),Eval("id")) %>">
                                <img alt="" src="LargeImage?w=61&h=61&type=<%#Eval("CategoryID") %>1&image=images/News/<%#Eval("FileName") %>" width="61" height="61" />
                                <span><%# DA.TextCut(Eval("Summary").ToString(),70) %></span></a>
                       
                             </div>
                    </ItemTemplate>
                </asp:Repeater>
                <a href="ViewAllNews-3" class="more fontStyle">شاهد المزيد</a>
            </div>
            <!--MAo,go!-->
        </div>
        <div class="clear"></div>
        <div class="Line1"></div>
        <div class="clear"></div>
        <div class="tahani PRelative">
            <h2 class="TColor fontStyle SColor RDir RText FRight PRelative"><span class="HTitleIcon HomeIcon"></span>تهاني وإهداءات ..</h2>
            <div class="box FRight">
                <div class="con">
                    <marquee direction="right" behavior="scroll" scrollamount="4" onmousemove="this.stop()" onmouseout="this.start()" width="100%" style="float: left">
                  <asp:repeater runat="server" id="RpDedications">
                     <ItemTemplate>
                        <a  class="fontStyle" dir="rtl">
                        { 
                        <span style="color:Red;"> <%#Eval("Name") %> </span>  //  <%# Eval("NewsComment") %>  
                        <img src="img/icon/<%#Eval("ImgIco") %>.png" width="25px" height="25px"> 
                        }   </a>
                     </ItemTemplate>
                  </asp:repeater>
                  <a  class="fontStyle" dir="rtl"  runat="server" id="NoDedications" visible="false">
                  {  لآ يوجد إهـدآءآت في هذآ اليوم     <img src="img/icon/15.png" width="25px" height="25px"> 
                  }   </a>
               </marquee>
                </div>
                <!--Con!-->
            </div>
            <!--Box!-->
            <asp:Literal ID="ltrAddDedications" runat="server"></asp:Literal>
        </div>
        <!--Tahany!-->
    </div>
    <div class="Line1"></div>
    <div class="newFooter">
        <div class="conf1" style="removed 160px;">
            <div><a href="Jobs" class="jobs"><span class="fontStyle TColor empH">لجنة إدارة الموقع  ..</span></a></div>
            <div class="medil"><a href="CommunicationView" class="contactHome"><span class="fontStyle TColor contactH">دليل التواصل</span></a></div>
            <%--<div><a href="QuranReciter" class="qeranHAA"><span class="fontStyle TColor qeranH">القرآن الكريم</span></a></div>--%>
        </div>
        <!--Conf1!-->
        <div class="Line1"></div>
        <div class="con2 FRight PRelative">
            <div class="con21">
                <h2 class="TColor fontStyle SColor RDir RText FRight PRelative"><span class="HTitleIcon HomeIcon"></span>حكمة اليوم ..</h2>
                <p class="FRight fontStyle RDir RText htext">
                    <asp:Repeater ID="RpHekmatAlyom" runat="server">
                        <ItemTemplate>
                            <%#DA.TextCut(Eval("Summary").ToString(), 350) %>
                        </ItemTemplate>
                    </asp:Repeater>
                </p>
            </div>
            <!--Remember!-->
            <div class="con22" style="margin-removed 20px;">
                <h2 class="TColor fontStyle SColor RDir RText FRight PRelative"><span class="HTitleIcon HomeIcon"></span>ارشيف الشخصيات ..</h2>
                <asp:Repeater ID="RpPersonality" runat="server">
                    <ItemTemplate>
                        <p class="FRight fontStyle RDir RText htext">
                            <img src="LargeImage?w=92&h=102&Type=Per0&Image=Images/Postions/<%#Eval("FileName") %>" width="92" height="102" alt="" />
                            <span>
                                <span class="TColor">الاسم:</span> <%#Eval("Name") %><br />
                                <span class="TColor">المهنة:</span> <%#Eval("Job") %><br />
                                <span class="TColor">النبذة</span><br />
                                <%#DA.TextCut(Eval("Note").ToString(),90) %>
                            </span>
                        </p>
                    </ItemTemplate>
                </asp:Repeater>
                <a href="PersonalityView" class="more fontStyle">شاهد المزيد</a>
            </div>
            <div class="con233">
                <h2 class="TColor fontStyle SColor RDir RText FRight PRelative"><span class="HTitleIcon HomeIcon"></span>كتاب قرأته ..</h2>
                <asp:Repeater ID="RpBookRead" runat="server">
                    <ItemTemplate>
                        <p class="FRight fontStyle RDir RText htext">
                            <img src="LargeImage?w=220&h=120&Type=Book1&Image=Images/Postions/<%#Eval("FileName") %>" width="255" height="152" alt="" />
                        </p>
                    </ItemTemplate>
                </asp:Repeater>
                <a href="BookReadView" class="more fontStyle">شاهد المزيد</a>
            </div>
            <!--MAo,go!-->
        </div>
    </div>
    <!--newFooter!-->
    <div class="Line1"></div>
    <div class="upfooter">
        <div class="foot1">
            <h2 class="TColor fontStyle SColor RDir RText FRight PRelative"><span class="HTitleIcon HomeIcon"></span>موقع الأسرة على تويتر ..</h2>
            <div class="TwitterCon clear">
                <asp:Literal ID="ltrTweets" runat="server"></asp:Literal>
            </div>
            <!--TwitterCon Width:300 Height254px;!-->
        </div>
        <!--Foott1!-->
        <div class="foot2">
            <h2 class="TColor fontStyle SColor RDir RText FRight PRelative"><span class="HTitleIcon HomeIcon"></span>استطلاع الرآي ..</h2>
            <uc2:Poll ID="Poll1"  runat="server" />
        </div>
        <!--Foot2!-->
        <div class="foot3">
            <h2 class="TColor fontStyle SColor RDir RText FRight PRelative"><span class="HTitleIcon HomeIcon"></span>موقع الأسرة على الفيس بوك ..</h2>
            <div class="FaceContanier">
                <%--<fb:like-box href="<%=facebook %>" width="300" height="240" show_faces="false" stream="true" header="false"></fb:like-box>--%>
                <iframe src="//www.facebook.com/plugins/likebox.php?href=https%3A%2F%2Fwww.facebook.com%2FInet.web&width&height=290&colorscheme=light&show_faces=true&header=true&stream=false&show_border=true&appId=479939268795887" scrolling="no" frameborder="0" style="border: none; overflow: hidden; height: 290px;" allowtransparency="true"></iframe>
            </div>
            <!--FaceContaner Width:300 Height:254px;!-->
        </div>
        <!--Foot3!-->
    </div>
    <!--UpFooter-->
</asp:Content>
Posted
Updated 14-Jun-15 12:43pm
v2
Comments
CHill60 14-Jun-15 16:20pm    
We will need to see the code that is throwing the exception. It looks as if you have not initialise the object DBAccess
Member 11765235 14-Jun-15 18:37pm    
Well,DBAccess is public class in System.Web.UI.Page
Member of App_Web_oscnz2mo and App_Web_oscnz2mo is an assembly in my references
Dave Kreskowiak 14-Jun-15 19:17pm    
This is where YOU step through the code and find where the exception is thrown. If it's thrown in an external library, either the the code you wrote to use this library didn't pass something into it the library expected or the library has some bug in it. Chances are good its the code you wrote.
Member 11765235 14-Jun-15 19:33pm    
I haven't the code of the library just I have permission to use it as assembly.dll.What can I do?

1 solution

The problem is somewhere in your Default.aspx page according to the stack trace.

The error means your code is trying to use a null object. Your code is assuming that it got back what it was expecting at some point and instead of getting and object, it got null and you're trying to use a property of method on it.

Beyond that, there's nothing helpful anyone can tell you due to the complete lack of information you provided.
 
Share this answer
 

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900