继承asp.net问题 [英] Inherit problem in asp.net

查看:364
本文介绍了继承asp.net问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的Web应用程序复制我在我的网页也源$ C ​​$ C开始形成了从其他网站上的code粘贴到
 当我运行它给像这样错误的应用程序

in my web application i copy and paste the code from other site to in my page also the source code starting form when i run the application it is giving the error like this

编译错误
说明:该请求提供服务所需资源的编译过程中出现错误。请检查下列特定错误详细信息并适当地修改源$ C ​​$ C。

Compilation Error Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.

编译器错误信息:ASPNET:请确保在这个code文件中定义的类继承属性匹配,并且它扩展了正确的基类(例如Page或UserControl)

Compiler Error Message: ASPNET: Make sure that the class defined in this code file matches the 'inherits' attribute, and that it extends the correct base class (e.g. Page or UserControl).

源错误:

1号线:使用系统;
线路2:使用System.Data这;
3号线:​​在使用的System.Web;

Line 1: using System; Line 2: using System.Data; Line 3: using System.Web;

源文件:C:\\的Inetpub \\ wwwroot的\\ DomainIV \\ WhoIs.aspx.cs行:1。

Source File: c:\Inetpub\wwwroot\DomainIV\WhoIs.aspx.cs Line: 1

这是我的问题,帮我感谢ü。

this is my problem help me thank u.

推荐答案

在你的aspx页面会出现在顶部以下内容:

In your aspx page there will be the following at the top:

<%@ Page Language="C#" MasterPageFile="~/Test.Master" AutoEventWireup="true" CodeBehind="Test.aspx.cs" Inherits="TestApp.Test" Title="Untitled Page" %>

在您的.cs文件的类将像定义:

In your .cs file your class will be defined like:

namespace TestApp
{
    public partial class Test : System.Web.UI.Page
    {

请务必在aspx页面继承的财产在cs文件的类定义相匹配。在它上面的例子是TestApp.Test在继承财产和类必须具有相同的命名空间和类名TestApp和测试。

Make sure the inherits property in the aspx page matches the class definition in the .cs file. In the example above it is 'TestApp.Test' in the inherits property and the class must have the same namespace and classname TestApp and Test.

您可能复制的文件中的一个的全部内容,现在的两片不再匹配。

You probably copied the whole contents of one of the files and now the two pieces no longer match up.

这篇关于继承asp.net问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆