Saturday, March 24, 2012

Newbie Help (Parser Error)

I just created a test asp.net application using VB.net. I have DotNetFramework 1.1 installed.

The default.aspx page simply displays a form and a heading:

PAGE CODE:
------
<%@dotnet.itags.org. Page Language="VB" %>
<html>
<body>
<form id='form1' method='post' runat='server'>
<h1> Welcome to First Application</h1>
<asp:button id='btnNavigate' runat='server' text='Navigate'/>
</form>
</body>
</html
--------

When I run the application I get the following error.

ERROR MESSAGE:
--------
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 'firstapp.Global'.

Source Error:

Line 1: <%@dotnet.itags.org. Application Codebehind="Global.asax.vb" Inherits="firstapp.Global" %
Source File: c:\inetpub\wwwroot\firstapp\global.asax Line: 1

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

I am not sure why. The application was install as an asp.net application on IIS 5.

Any help would be greatly appreciated. My email is tcornett@dotnet.itags.org.ci.kingman.az.us

Thanks,

Terry C.There are several files required for an ASP.NET web app:
1. Your web form(s)
2. The web.config file
3. The Global.asax file

The Global.asax file must define a class called Global, subclassed from httpApplication. It appears that you have defined a Global.asax file and it refers to a code behind file that should define that Global class. Most likely, you have not compiled the file Global.asax.vb into an assembly that is part of your \bin folder. (All .vb files can be compiled into one single assembly. If you are using Visual Studio.net, that should happen automatically, assembling Global.asax is in your solution and it's Build Action property is set to "Compile".)
Thanks Peter.

I did not realize I had to build the solution for such a simple test web application. The book I was using as a reference did not mention that.

Once I built the solution it worked.

Thanks again for the help.

Terry C. :-)

0 comments:

Post a Comment