得到一个错误,可能是WebResource.axd

时间:2013-05-13 09:21:45

标签: c# javascript asp.net config webresource

我遇到了一些麻烦,我认为问题是Webresource.axd文件。我正在使用ASP.NET Web Form与.NET 4.5和Visual Studio 2012 Web Developer Express。

我在我的aspx文件中声明了一个树视图,在代码隐藏中我将数据分配给了树视图。这是有效的,但在那里我成了一些丢失的图片,但我使用标准的Systemset。 so it it shown in the Browser

以下是我的代码:

的.aspx:

<asp:TreeView ID="treeview" runat="server" ShowLines="True" ImageSet="Arrows">

</asp:TreeView>

.aspx.cs:

protected void Page_Load(object sender, EventArgs e)
{
    if (!Page.IsPostBack)
    {
       Logic.TreeView("FILE", treeview);
    }
}

的web.config:

<?xml version="1.0" encoding="utf-8"?>

<!--
  Weitere Informationen zum Konfigurieren der ASP.NET-Anwendung finden Sie unter
  http://go.microsoft.com/fwlink/?LinkId=169433
  -->

    <configuration>
  <system.web>
    <compilation debug="true" targetFramework="4.5" />
    <httpRuntime targetFramework="4.5" />

      <httpHandlers>
        <add path="WebResource.axd" verb="GET" type="System.Web.Handlers.AssemblyResourceLoader" validate="true"/>
      </httpHandlers>

  </system.web>
  <system.serviceModel>
    <serviceHostingEnvironment aspNetCompatibilityEnabled="true"/>
    <standardEndpoints>
      <webHttpEndpoint>
        <standardEndpoint name="" helpEnabled="true" automaticFormatSelectionEnabled="true" crossDomainScriptAccessEnabled="true"/>
      </webHttpEndpoint>
      <webScriptEndpoint>
        <standardEndpoint crossDomainScriptAccessEnabled="true"/>
      </webScriptEndpoint>
    </standardEndpoints>
  </system.serviceModel>


  <system.webServer>
    <validation validateIntegratedModeConfiguration="false"/>
  </system.webServer>


</configuration>

当我开始调试时,我收到了JS错误,但仅在IE中,而不是在Chrome中。 Microsoft JScript中的运行时错误:“WebForm_InitCallback”未定义

有人可以提供帮助吗,我真的不知道如何解决这个问题。

1 个答案:

答案 0 :(得分:0)

首先尝试一些简单的事情:

是指定位置的文件(可能使用firebug或类似的查看元素来查找位置,可能会与〜/ ./路径混淆)。

如果您正在使用服务器操作系统,那么您在服务器管理器中勾选了“静态内容”角色,否则将无法显示CSS和图像。