系统本地测试无错误   服务器上运行报错   错误信息如下:
Server Error in '/' Application.
--------------------------------------------------------------------------------Object variable or With block variable not set. 
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.NullReferenceException: Object variable or With block variable not set.Source Error: An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.  Stack Trace: 
[NullReferenceException: Object variable or With block variable not set.]
   Microsoft.VisualBasic.CompilerServices.LateBinding.LateGet(Object o, Type objType, String name, Object[] args, String[] paramnames, Boolean[] CopyBack) +423428
   HhSoft.wcc.RecordEdit.FillControl() +372
   HhSoft.wcc.RecordEdit.DataBind() +757
   publicHotle.Added.Add_T_Personal_integral_send.Page_Load(Object sender, EventArgs e) in F:\怀化移动酒店系统\publicHotle\publicHotle\Added\Add_T_Personal_integral_send.aspx.cs:87
   System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +14
   System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +35
   System.Web.UI.Control.OnLoad(EventArgs e) +99
   System.Web.UI.Control.LoadRecursive() +50
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +627 
  目前知道是WITH块错误 但是怎么改问下各位大侠

解决方案 »

  1.   

    权限问题,把你发布的文件夹权限设置下,设置成IUSER_ 与 User IIS_WPG这几个用户的读写权限打开。
      

  2.   


    在本地又没问题你的web.config中authorization是怎么配置的?
      

  3.   


    <?xml version="1.0"?>
    <configuration>
    <appSettings>
    <add key="sql1" value="server=wlj;database=hotle;uid=sa;pwd=sa" />
    </appSettings> <connectionStrings/>
    <system.web>
    <!-- 
                设置 compilation debug="true" 可将调试符号插入
                已编译的页面中。但由于这会 
                影响性能,因此只在开发过程中将此值 
                设置为 true。
            -->
    <compilation debug="true" defaultLanguage="c#" />
    <!--
                通过 <authentication> 节可以配置 ASP.NET 用来 
                识别进入用户的
                安全身份验证模式。 
            -->
    <authentication mode="Windows"/>
    <!--
                如果在执行请求的过程中出现未处理的错误,
                则通过 <customErrors> 节可以配置相应的处理步骤。具体说来,
                开发人员通过该节可以配置
                要显示的 html 错误页
                以代替错误堆栈跟踪。        <customErrors mode="Off" >
                <error statusCode="403" redirect="NoAccess.htm" />
                <error statusCode="404" redirect="FileNotFound.htm" />
            </customErrors>
            -->
    <pages validateRequest="false">
    <controls>
    <add tagPrefix="PageUC1" tagName="Header" src="~/Control/Header.ascx"/>
    <add tagPrefix="PageUC1" tagName="Footer" src="~/Control/Footer.ascx"/>
    <add tagPrefix="PageUC1" tagName="PageEditBar" src="~/Control/PageEditBar.ascx"/>
    <add tagPrefix="PageUC1" tagName="HeaderIndex" src="~/Control/HeaderIndex.ascx"/>
    <add tagPrefix="PageUC1" tagName="AdvancedSearch" src="~/Control/AdvancedSearch.ascx"/>
    <add tagPrefix="HhSoft" namespace="HhSoft.wcc" assembly="HhSoft.wcc"/>
    <add tagPrefix="HhSoft" namespace="HhSoft.wfw" assembly="HhSoft.wfw"/>
    <add tagPrefix="HhSoft" namespace="HhSoft.wpc" assembly="HhSoft.wpc"/>
    <add tagPrefix="HhSoft" namespace="HhSoft.wuc" assembly="HhSoft.wuc"/>
    </controls>
    </pages>
    </system.web>
    </configuration>
      

  4.   


    <allow users="*" />加上试试看