Error: member names cannot be the same as their enclosing type
11/11/2009
0
Bom dia amigos, estou utilizando o vs 2008 .net 3.5, quando eu compilo meu projeto o seguinte erro é acusado: "informacoes":member names cannot be the same as their enclosing type
Segue o codigo c# e html gerado.
using System; using System.Collections; using System.Configuration; using System.Data; using System.Linq; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.HtmlControls; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Xml.Linq; //SCAP using System.ComponentModel; using System.Drawing; using System.Web.SessionState; using PortusCommon; using CPD.Projetos.Porto.Pages.BaseAutPage; using SCAP; public partial class informacoes : BaseAutPage // System.Web.UI.Page { #region Public Object #endregion #region Private Methods #endregion #region Event Handlers protected void Page_Load(object sender, System.EventArgs e) { base.Page_Load(sender, e); lblPerfil.Text = Helper.RetornaPerfil(Usuario.GetCodigoPerfil().ToString()); lblUsuario.Text = Usuario.GetNomeUsuario(); lblDataHora.Text = DateTime.Now.ToString("dd/MM/yyyy HH:mm:ss"); } #endregion } ========================================================================================================================================================================================== <%@ Page Language="C#" AutoEventWireup="true" CodeFile="informacoes.aspx.cs" Inherits="informacoes" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title>informacoes</title> </head> <body MS_POSITIONING="GridLayout"> <form id="informacoes" runat="server"> <span id="span_informacoes"> <table width="100%" id="ParaImprimir"> <tr class="texto_campos"> <td width="50%" style="BORDER-RIGHT:medium none; BORDER-TOP:medium none; BORDER-LEFT:medium none; BORDER-BOTTOM:medium none"> <asp:Label ID="lblUsuario" Runat="server"></asp:Label> / <asp:Label ID="lblPerfil" Runat="server"></asp:Label> </td> <td width="50%" align="right" style="BORDER-RIGHT:medium none; BORDER-TOP:medium none; BORDER-LEFT:medium none; BORDER-BOTTOM:medium none"> <asp:Label ID="lblDataHora" Runat="server"></asp:Label> </td> </tr> <tr class="texto_campos"> <td colspan="2" style="BORDER-RIGHT:medium none; BORDER-TOP:medium none; BORDER-LEFT:medium none; BORDER-BOTTOM:medium none"> </td> </tr> </table> </span> </form> <script> window.parent.document.all["span_usuario"].innerText = window.document.all["lblUsuario"].innerText; window.parent.document.all["span_perfil"].innerText = window.document.all["lblPerfil"].innerText; </script> </body> </html> Alguem saberia responder?
Segue o codigo c# e html gerado.
using System; using System.Collections; using System.Configuration; using System.Data; using System.Linq; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.HtmlControls; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Xml.Linq; //SCAP using System.ComponentModel; using System.Drawing; using System.Web.SessionState; using PortusCommon; using CPD.Projetos.Porto.Pages.BaseAutPage; using SCAP; public partial class informacoes : BaseAutPage // System.Web.UI.Page { #region Public Object #endregion #region Private Methods #endregion #region Event Handlers protected void Page_Load(object sender, System.EventArgs e) { base.Page_Load(sender, e); lblPerfil.Text = Helper.RetornaPerfil(Usuario.GetCodigoPerfil().ToString()); lblUsuario.Text = Usuario.GetNomeUsuario(); lblDataHora.Text = DateTime.Now.ToString("dd/MM/yyyy HH:mm:ss"); } #endregion } ========================================================================================================================================================================================== <%@ Page Language="C#" AutoEventWireup="true" CodeFile="informacoes.aspx.cs" Inherits="informacoes" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title>informacoes</title> </head> <body MS_POSITIONING="GridLayout"> <form id="informacoes" runat="server"> <span id="span_informacoes"> <table width="100%" id="ParaImprimir"> <tr class="texto_campos"> <td width="50%" style="BORDER-RIGHT:medium none; BORDER-TOP:medium none; BORDER-LEFT:medium none; BORDER-BOTTOM:medium none"> <asp:Label ID="lblUsuario" Runat="server"></asp:Label> / <asp:Label ID="lblPerfil" Runat="server"></asp:Label> </td> <td width="50%" align="right" style="BORDER-RIGHT:medium none; BORDER-TOP:medium none; BORDER-LEFT:medium none; BORDER-BOTTOM:medium none"> <asp:Label ID="lblDataHora" Runat="server"></asp:Label> </td> </tr> <tr class="texto_campos"> <td colspan="2" style="BORDER-RIGHT:medium none; BORDER-TOP:medium none; BORDER-LEFT:medium none; BORDER-BOTTOM:medium none"> </td> </tr> </table> </span> </form> <script> window.parent.document.all["span_usuario"].innerText = window.document.all["lblUsuario"].innerText; window.parent.document.all["span_perfil"].innerText = window.document.all["lblPerfil"].innerText; </script> </body> </html> Alguem saberia responder?
Otton Moura
Curtir tópico
+ 0
Responder
Posts
11/11/2009
Otton Moura
Aew galera, valeu pela ajuda, mas eu já consegui fazer debugar sem erro.
Não sei explicar o erro ao certo, eu apenas troquei o meu c# e o meu html para esse aqui..
using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
//SCAP
using System.ComponentModel;
using System.Drawing;
using System.Web.SessionState;
using PortusCommon;
using CPD.Projetos.Porto.Pages.BaseAutPage;
using SCAP;
public partial class Informacoes : BaseAutPage
{
#region Public Object
#endregion
#region Private Methods
#endregion
#region Event Handlers
protected void Page_Load(object sender, EventArgs e)
{
base.Page_Load(sender, e);
if (!IsPostBack)
{
lblPerfil.Text = Helper.RetornaPerfil(Usuario.GetCodigoPerfil().ToString());
lblUsuario.Text = Usuario.GetNomeUsuario();
lblDataHora.Text = DateTime.Now.ToString("dd/MM/yyyy HH:mm:ss");
}
}
#endregion
}
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Informacoes.aspx.cs" Inherits="Informacoes" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>informacoes</title>
</head>
<body>
<form id="informacoes" method="post" runat="server">
<div>
<span id="span_informacoes">
<table width="100%" id="ParaImprimir">
<tr class="texto_campos">
<td width="50%" style="border-right: medium none; border-top: medium none; border-left: medium none;
border-bottom: medium none">
<asp:Label ID="lblUsuario" runat="server"></asp:Label>
/
<asp:Label ID="lblPerfil" runat="server"></asp:Label>
</td>
<td width="50%" align="right" style="border-right: medium none; border-top: medium none;
border-left: medium none; border-bottom: medium none">
<asp:Label ID="lblDataHora" runat="server"></asp:Label>
</td>
</tr>
<tr class="texto_campos">
<td colspan="2" style="border-right: medium none; border-top: medium none; border-left: medium none;
border-bottom: medium none">
</td>
</tr>
</table>
</span>
</div>
</form>
<script type="text/javascript" language="javascript">
window.parent.document.all["span_usuario"].innerText = window.document.all["lblUsuario"].innerText;
window.parent.document.all["span_perfil"].innerText = window.document.all["lblPerfil"].innerText;
</script>
</body>
</html>
Responder
Clique aqui para fazer login e interagir na Comunidade :)