您的位置:首页 > 移动开发

Tree View works through VWD but not via local host or from a remote browser. /Server Error in '/' Application.

2007-06-14 14:52 525 查看
Tree View works through VWD but not via local host or from a remote browser.
Running the application through visual web developer and it works fine. But through local host or remotely, I get the following error:

Server Error in '/' Application.
--------------------------------------------------------------------------------

Parser Error Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately.

Parser Error Message: Could not load type System.Web.UI.WebControls.SiteMapDataSource from assembly System.Web, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a.

Source Error:

Line 7: <body>
Line 8: <form runat="server">
Line 9: <asp:SiteMapDataSource ID="mySiteMapDataSource"
Line 10: runat="server" />
Line 11: <asp:TreeView ID="myTreeView" runat="server"

Source File: c:/inetpub/wwwroot/sitemap_and_tree_view/TreeViewDemo.aspx Line: 9

--------------------------------------------------------------------------------

Version Information: Microsoft .NET Framework Version:1.1.4322.2379; ASP.NET Version:1.1.4322.2379

The code in the page:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"

"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html>

<head>

<title>TreeView Demo</title>

</head>

<body>

<form runat="server">

<asp:SiteMapDataSource ID="mySiteMapDataSource"

runat="server" />

<asp:TreeView ID="myTreeView" runat="server"

DataSourceID="mySiteMapDataSource" />

</form>

</body>
</html>

The sitemap file code:

<siteMap

xmlns="http://schemas.microsoft.com/AspNet/SiteMap-File-1.0">
<siteMapNode title="Home" url="~/Default.aspx"

description="Home">
<siteMapNode title="TreeViewDemo" url="~/TreeViewDemo.aspx"

description="TreeView Example" />
<siteMapNode title="ClickEvent" url="~/ClickEvent.aspx"

description="ClickEvent Example" />
<siteMapNode title="Loops" url="~/Loops.aspx"

description="Loops Example" />
</siteMapNode>

</siteMap>

I'm at a loss as it appears it's exactly as the book describes it.

 


foolios
View Public Profile
Find More Posts by foolios

Yesterday, 18:49
  #2
wwb_99

Community Advisor





 



 
Join Date: May 2003
Location: Washington, DC
Posts: 5,344

Key thing to note is

Quote:
System.Web, Version=1.0.5000.0
Your app is running in .NET 1.x, and DataSourceControls in general are .NET 2.0 or better controls. Make sure the .NET framework 2.0 is installed and that you have the virtual directory setup for .NET 2.0.

 


wwb_99
View Public Profile
Find More Posts by wwb_99

Yesterday, 21:11
  #3
foolios

SitePoint Enthusiast



 



 
Join Date: Dec 2006
Location: The least technologically advanced state in the US
Posts: 75

Thank you for this information. I checked what version is installed via add/remove programs and I see .net 2 framework is installed. I went to IIS and see that it is using 1.1. Could someone point out how I can tell IIS to use 2.0 instead?
Thanks so much.

Found it, Thank you.

http://hkvstore.com/aspnetmaker/doc/aspnet2primer.htm
 
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
相关文章推荐