嗨,我有一个Webforms项目,其中包含代码隐藏的每个页面的程序集。当我运行我的项目时,我发现了这个错误 [英] Hi, I have a Webforms project that contains assemblies for every page where is the code-behind. When I run my project I found this error

查看:98
本文介绍了嗨,我有一个Webforms项目,其中包含代码隐藏的每个页面的程序集。当我运行我的项目时,我发现了这个错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

[NullReferenceException:对象引用未设置为对象的实例。]

DBAccess.setConnString()+77

DBAccess。 .ctor()+140

_Default..ctor()+49

ASP.default_aspx..ctor()in c:\ Users \DELL \ AppData \本地\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 \\\ t \\ aa4 \ 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.PageHandl erFactory.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&已完成异步)+155



我的Default.aspx代码:

[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:

<%@ 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>

推荐答案

(document).ready(function () {
(document).ready(function () {


(\".ColorIcon div\").click(function (e) {
(".ColorIcon div").click(function (e) {


(\".loading img\").attr(\"src\", \"loading/\" +
(".loading img").attr("src", "loading/" +


这篇关于嗨,我有一个Webforms项目,其中包含代码隐藏的每个页面的程序集。当我运行我的项目时,我发现了这个错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆