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

来源:互联网 发布:万网域名抢注 编辑:程序博客网 时间:2024/06/05 02:01
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 is offline   Reply With Quote
Old Yesterday, 18:49   #2
wwb_99
Community Advisor
SitePoint Award Recipient
 
wwb_99's Avatar
 
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 is offline   Reply With Quote
Old Yesterday, 21:11   #3
foolios
SitePoint Enthusiast
 
foolios's Avatar
 
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
 
原创粉丝点击