部件名称不能与它们的封闭类型 [英] member names cannot be the same as their enclosing type

查看:155
本文介绍了部件名称不能与它们的封闭类型的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我尝试运行在Visual Studio 2008的Web应用程序..我得到这个错误...


  

PopupWindow:成员名称不能与它们的封闭类型


也同时纠正错误,我的启动网页changed..dont懂得挫折原来启动的网页...

 公共部分类PopupWindow {
    ///<总结>
    /// frmPopupWindow控制。
    ///< /总结>
    ///<&言论GT;
    ///自动生成的字段。
    ///要修改移动领域的声明从设计文件code隐藏文件。
    ///< /言论>
    保护全球:: System.Web.UI.HtmlControls.HtmlForm frmPopupWindow;
    ///<总结>
    /// PopupWindow1控制。
    ///< /总结>
    ///<&言论GT;
    ///自动生成的字段。
    ///要修改移动领域的声明从设计文件code隐藏文件。
    ///< /言论>
    保护全球:: Sdi.Pss.WebControls.Control PopupWindow;
}


解决方案

您已经有了一个名为 PopupWindow 字段在一个名为类 PopupWindow 。只是不这样做。改变字段的名称别的东西。

相当为什么这会影响你的启动网页,我不知道......平时我只是按F5时,我已经得到了我想要强调:)您可以在项目属性的网络部分指定它的页面虽然。

when i try to run an web application in visual studio 2008.. i got this error...

'PopupWindow': member names cannot be the same as their enclosing type

also while correcting errors my startup web page changed..dont know how to setback the original startup webpage...

public partial class PopupWindow {
    /// <summary>
    /// frmPopupWindow control.
    /// </summary>
    /// <remarks>
    /// Auto-generated field.
    /// To modify move field declaration from designer file to code-behind file.
    /// </remarks>
    protected global::System.Web.UI.HtmlControls.HtmlForm frmPopupWindow;
    /// <summary>
    /// PopupWindow1 control.
    /// </summary>
    /// <remarks>
    /// Auto-generated field.
    /// To modify move field declaration from designer file to code-behind file.
    /// </remarks>
    protected global::Sdi.Pss.WebControls.Control PopupWindow;
}

解决方案

You've got a field called PopupWindow in a class called PopupWindow. Just don't do that. Change the name of the field to something else.

Quite why this affected your startup web page I don't know... normally I just hit F5 when I've got the page I want highlighted :) You can specify it in the "Web" part of your project properties though.

这篇关于部件名称不能与它们的封闭类型的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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