I created a new web site from vs2005. It contains a default.aspx and a web.config.
From vs2005, I added a new Web Form: WebForm1
and from a hyperlink
<
asp:HyperLink
ID="HyperLink1"
runat="server"
NavigateUrl="~/WebForm1.aspx">HyperLink</asp:HyperLink></div>
in the default.aspx, I called the WebForm1.
The error is:
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 'RMS.WebSite.WebForm1'.
Source Error:
Line 1: <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm1.aspx.cs" Inherits="RMS.WebSite.WebForm1" %>
Line 2:
Line 3: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
did you build (Ctrl+Shift+B) the application before trying to view the page? Is the namespace in aspx (Inherits attribute in @Page directive) correct one?
Freedon Nadd
0 Points
7 Posts
Could not load type 'WebForm1'
Jun 26, 2008 07:52 PM|LINK
Hi all,
I created a new web site from vs2005. It contains a default.aspx and a web.config.
From vs2005, I added a new Web Form: WebForm1
and from a hyperlink<
asp:HyperLink ID="HyperLink1" runat="server" NavigateUrl="~/WebForm1.aspx">HyperLink</asp:HyperLink></div> in the default.aspx, I called the WebForm1.The error is:
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 'RMS.WebSite.WebForm1'.
Source Error:
Source File: /RMS.ReportWebSite/WebForm1.aspx Line: 1
What is the solution? I can't seem to found the problem.
Thanks for your help.
Freedon Nadd
Version Information: Microsoft .NET Framework Version:2.0.50727.1434; ASP.NET Version:2.0.50727.1434
joteke
All-Star
46284 Points
6896 Posts
ASPInsiders
MVP
Re: Could not load type 'WebForm1'
Jun 26, 2008 08:03 PM|LINK
Hi,
did you build (Ctrl+Shift+B) the application before trying to view the page? Is the namespace in aspx (Inherits attribute in @Page directive) correct one?
Teemu Keiski
Finland, EU
drocco
Member
596 Points
566 Posts
Re: Could not load type 'WebForm1'
Jun 26, 2008 08:04 PM|LINK
Try building the page
F5 in Visual Studio
anas
All-Star
73649 Points
7914 Posts
Moderator
Re: Could not load type 'WebForm1'
Jun 26, 2008 08:05 PM|LINK
The class in code behind of webform1 must be inside "RMS.WebSite" namespace , and must have "WebForm1" as a name ,
post the weboform1 code behind .
Freedon Nadd
0 Points
7 Posts
Re: Could not load type 'WebForm1'
Jun 26, 2008 08:29 PM|LINK
<%
@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm1.aspx.cs" Inherits="RMS.WebSite.WebForm1" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><
html xmlns="http://www.w3.org/1999/xhtml" ><
head runat="server"> <title>Untitled Page</title></
head><
body> <form id="form1" runat="server"> <div>
</div> </form></
body></
html>
I found the solution:I Changed CodeBehind="WebForm1.aspx.cs" to CodeFile="WebForm1.aspx.cs"
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="WebForm1.aspx.cs" Inherits="RMS.WebSite.WebForm1" %>
Everything works fine now, thanks
Freedon Nadd
</div></form>