Compiler error message: CS0716: cannot be converted to static type "System. Web. SiteMap"

Source: Internet
Author: User
Compiler error message: CS0716: cannot be converted to static type "System. Web. SiteMap"

A problem encountered today, SiteMap. aspx. an error occurred after page compilation because :. when defining the page class in the CS class, the class name is SiteMap, and the static System. web. duplicate SiteMap name ,. the CS SiteMap class cannot be converted to static. An error is reported after compilation. This is true for MS. However, running the program directly does not cause errors. This is for Xiami ..

The program runs correctly. The compilation is successful, but an error occurs after the program is released. You can help me to see it. It has been depressing for several days.

Compilation Error
Note: An error occurs during compilation of resources required to provide services to this request. Check the following error details and modify the source code as appropriate.
Compiler error message: CS0716: cannot be converted to static type "System. Web. SiteMap"
Source error:
Line 120: public sitemap_aspx (){
Line 121: string [] dependencies;
Line 122: (SiteMap) (this). AppRelativeVirtualPath = "~ /SiteMap. aspx ";
Line 123: if (global: ASP. sitemap_aspx. initialized = false )){
Line 124: Global: Asp. sitemap_aspx. stringresource = This. readstringresource ();

Source File: C:/Windows/Microsoft. NET/framework/v2.0.50727/Temporary ASP. NET files/root/171989b1/c89df8ef/app_web_sitemap.aspx.cdcab7d2.jyacigby.0.cs row: 122

 

Solution: When the CS page of sitemap. aspx is being reviewed
Using system;
Using system. Data;
Using system. configuration;
Using system. collections;
Using system. Web;
Using system. Web. Security;
Using system. Web. UI;
Using system. Web. UI. webcontrols;
Using system. Web. UI. webcontrols. webparts;
Using system. Web. UI. htmlcontrols;
Using system. text;
Using system. Collections. Generic;
Using Yuxiang. BLL;
Using Yuxiang. model;

Public partial class SiteMap: System. web. UI. page {// The class name here cannot be SiteMap. It may be the same as the system's SiteMap. I don't quite understand it. So I can change it to another name, And SiteMaps won't work either. For example, I can change it: siteMapcc,
Public partial class SiteMapcc: System. Web. UI. Page {//

Of course: SiteMap. modify the source view of aspx: <% @ Page Language = "C #" AutoEventWireup = "true" CodeFile = "SiteMap. aspx. cs "Inherits =" SiteMapcc "%>

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.