We help IT Professionals succeed at work.

Error in website after publishing

toooki
toooki asked
on
I can compile a ASP.NET VS2008 C# solution (has multiple projects). It comes up ok on local PC. When I publish it succeeds but I get error when I go to the website http:// ... /Mypage.aspx.
But http:// ... /Test1.aspx works.

The website says:
Server Error in '/ApplicationName' Application.

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 'MyWebSln.Mypage'.

Source Error:

Line 1:  <%@ Page Language="C#" MasterPageFile="~/MasterPages/MainMaster.Master" AutoEventWireup="true" CodeBehind="Mypage.aspx.cs" Inherits="MySln.Mypage" Title="My Page" %>
Line 2:  <asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
Line 3:      <style type='text/css'>



Line 1 shows in RED font and rest in usual..
I cannot figure out why it is wrong..
Comment
Watch Question

GlobaLevelProgrammer

Commented:
can you provide a screen shot of your VS so that we can see w3hat the errors are during runtime...also make sure that the page directive lines up...

Author

Commented:
Thank you.
I have attached the screenshot of the website that shows the error.

Also put the first line below.javascript:void(0); screen
<%@ Page Language="C#" MasterPageFile="~/MasterPages/MainMaster.Master" AutoEventWireup="true" CodeBehind="BranchParentMap.aspx.cs" Inherits="MySln.BranchParentMap" Title="My Page" %>

Open in new window

Development, GIS Consultant - Haram Presidency
CERTIFIED EXPERT
Commented:
I can't think of a cause of this, but make sure that the code behind has a
namespace MySln

but i guess your problem is different, since it compiles OK.
namespace MySln
{
    public partial class BranchParentMap : System.Web.UI.Page

Open in new window

Author

Commented:
Thank you.

I checked many times it is:
namespace MySln
{
    public partial class BranchParentMap : System.Web.UI.Page

The same I have with Test.aspx file which works...

Author

Commented:
I get error -- but of different kind -- when I try to publish it to my local IIS location:

C:\Inetpub\wwwroot\PDM\

http://www.experts-exchange.com/Programming/Languages/.NET/ASP.NET/Q_27445893.html

Explore More ContentExplore courses, solutions, and other research materials related to this topic.