Compilation Error

An error occurred while the compilation of a resource required to service this request. Please review the following specific error details and modify your source code accordingly

.
Compiler Error Message: CS0030: Cannot convert type ‘ASP.view_aspx’ to ‘System.Web.UI.WebControls.View’
Source Error:

Line 120: public view_aspx() {
Line 121: string[] dependencies;
Line 122: ((View)(this)).AppRelativeVirtualPath = “~/View.aspx”;
Line 123: if ((global::ASP.view_aspx.@__initialized == false)) {
Line 124: global::ASP.view_aspx.@__stringResource = this.ReadStringResource();

Steps to remove this Error:

You will need to rename the class associated with the ASP.NET Page to something other than the name you are using.

  1. Open the Page’s Designer and Code pages.
  2. Rename the Page’s class name to something else.
  3. In the code behind page, just append “Page” to the class name such as “public partial class ViewPage : System.Web.UI.Page”
  4. In the design view page, append the same value such as “<%@ Page … CodeFile=”View.aspx.cs” Inherits=”ViewPage“… %>”
  5. Save and Publish your web site.

Leave a Reply