• 博客园logo
  • 会员
  • 众包
  • 新闻
  • 博问
  • 闪存
  • 赞助商
  • HarmonyOS
  • Chat2DB
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录

我们将共同携手迎接你的到来!


新的一年
新的开始
新的目标
新的收获

kevin 愛戀 20140103

博客园          联系   管理     
asp.net的Login.aspx.cs出错解决办法

帐户登录界面的文件叫Login.aspx,后台代码为Login.aspx.cs

在VS.NET 2005下测试通过,可发布后,在IIS下运行,则有如下错误提示。

 

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.

Line 114:        public login_aspx() 
{Line 115:            string[] dependencies;Line 116:       
     ((Login)(this)).AppRelativeVirtualPath = "~/Login.aspx";Line 117:        
    if ((global::ASP.login_aspx.@__initialized == false)) {Line 118:      
          global::ASP.login_aspx.@__stringResource = this.ReadStringResource();



 

Server Error in '/' Application.

Compilation Error

 

Warning: CS0108: 'ASP.login_aspx.Profile' hides inherited member 'Login.Profile'. Use the new keyword if hiding was intended.
Source Error:

Warning: CS0108: 'ASP.login_aspx.ApplicationInstance' hides inherited member

 'Login.ApplicationInstance'. Use the new keyword if hiding was intended.
Source Error:

Show Detailed Compiler Output:

Show Complete Compilation Source:

Version Information: Microsoft .NET Framework Version:2.0.50727.42; ASP.NET Version:2.0.50727.42

 

===========================================================================

这是因为.NET Framework 2.0 版中新增Login类.而我们又增加Login.aspx,就会有冲突。

解决法办:

把原来这个

public partial class Login : System.Web.UI.Page
{

...

}

改为别的,如

public partial class AccountLogin : System.Web.UI.Page
{

...

}

aspx文件里的也要改动,如下:

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Login.aspx.cs" Inherits="Login" Culture="auto" UICulture="auto" %>

 

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Login.aspx.cs" Inherits="AccountLogin" Culture="auto" UICulture="auto" %>

 这样居然 就 OK 啦 ! 有点感叹 MS........

posted on 2010-07-29 17:46  kevin_20131022  阅读(569)  评论(0)    收藏  举报
刷新页面返回顶部
博客园  ©  2004-2025
浙公网安备 33010602011771号 浙ICP备2021040463号-3