Usuário com melhor resposta
Erro desconhecido. Eu ja tenho o runat=server.....estranho

Pergunta
-
<asp:Panel runat="server" ID="pnlSearch" Visible="true">
<h1>Pesquisa de Mailing</h1>
<ul>
<li>
<asp:Label ID="Label11" runat="server" Text="Cliente"></asp:Label>
<asp:DropDownList ID="DropDownListCliente" CssClass="radiusInput" runat="server" Height="32px"
Width="200px">
<asp:ListItem Selected="True">CNA</asp:ListItem>
<asp:ListItem>ARTSIM</asp:ListItem>
<asp:ListItem>BIORITMO</asp:ListItem>
</asp:DropDownList>
</li>
<br />
<li>
<asp:Button ID="btnSearch" CssClass="btn btnSearch" runat="server" Text="Pesquisar" OnClick="btnSearch_Click" />
</li>
</ul>
</asp:Panel>Erro de Servidor no Aplicativo '/'.
Controle 'DropDownListCliente' do tipo 'DropDownList' deve ser inserido em uma marca de formato com runat=server.
Descrição: Ocorreu uma exceção sem tratamento durante a execução da atual solicitação da Web. Examine o rastreamento de pilha para obter mais informações sobre o erro e onde foi originado no código.
Detalhes da Exceção: System.Web.HttpException: Controle 'DropDownListCliente' do tipo 'DropDownList' deve ser inserido em uma marca de formato com runat=server.
Erro de Origem:Exceção sem tratamento foi gerada durante a execução da atual solicitação da Web. As informações relacionadas à origem e ao local da exceção podem ser identificadas usando-se o rastreamento de pilha de exceção abaixo.
Rastreamento de Pilha:[HttpException (0x80004005): Controle 'DropDownListCliente' do tipo 'DropDownList' deve ser inserido em uma marca de formato com runat=server.] System.Web.UI.Page.VerifyRenderingInServerForm(Control control) +9745742 System.Web.UI.WebControls.ListControl.AddAttributesToRender(HtmlTextWriter writer) +46 System.Web.UI.WebControls.DropDownList.AddAttributesToRender(HtmlTextWriter writer) +47 System.Web.UI.WebControls.WebControl.RenderBeginTag(HtmlTextWriter writer) +20 System.Web.UI.WebControls.WebControl.Render(HtmlTextWriter writer) +20 System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +66 System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +100 System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +25 System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +128 System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) +13 System.Web.UI.WebControls.WebControl.RenderContents(HtmlTextWriter writer) +12 System.Web.UI.WebControls.WebControl.Render(HtmlTextWriter writer) +32 System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +66 System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +100 System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +25 System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +128 System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) +13 System.Web.UI.Page.Render(HtmlTextWriter writer) +29 System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +66 System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +100 System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +25 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +5827
Informações sobre a Versão: Microsoft .NET Framework Versão:4.0.30319; Versão do ASP.NET:4.6.1073.0
Respostas
-
Bom dia,
Você precisa colocar esses código dentro do form
<form runat="server"></form>
- Marcado como Resposta Thales F Quintas quinta-feira, 2 de junho de 2016 12:20
Todas as Respostas
-
Boa noite,
Amigo, também não encontrei erro no seu código. Tem mais algum "componente na tela"? Ja tentou reiniciar o VS ?
Att,
Se a resposta contribuiu com seu aprendizado por favor marque como util, se solucionou seu problema marque como resposta.
-
Ola
Obrigado por responder.
Ja reiniciei o VS e não deu certo. O Erro continua o mesmo.
Segue o codigo completo:
<%@ Page Title="Mailing B2B" Language="C#" AutoEventWireup="true" CodeBehind="MailingB2B.aspx.cs"
Inherits="ControledeUsuarios.MailingB2B" %>
<asp:Panel runat="server" ID="pnlSearch" Visible="true">
<h1>Pesquisa de Mailing</h1>
<ul>
<li>
<asp:Label ID="Label11" runat="server" Text="Cliente"></asp:Label>
<asp:DropDownList ID="DropDownListCliente" CssClass="radiusInput" runat="server" Height="32px"
Width="200px">
<asp:ListItem Selected="True">CNA</asp:ListItem>
<asp:ListItem>ARTSIM</asp:ListItem>
<asp:ListItem>BIORITMO</asp:ListItem>
</asp:DropDownList>
</li>
<br />
<li>
<asp:Button ID="btnSearch" CssClass="btn btnSearch" runat="server" Text="Pesquisar" OnClick="btnSearch_Click" />
</li>
</ul>
</asp:Panel>
<li>
<asp:Button ID="btnEnviarEmail" CssClass="btn btnSearch" runat="server" Text="Enviar" OnClick="btnEnviarEmail_Click" />
</li>
<asp:Fileupload id = "FileUpLoad1" runat = "server" />
<asp:Button id = "UploadBtn" Texto = "Enviar arquivo" OnClick = "UploadBtn_Click" runat = "server" Largura = "205px" />
<br />
<asp:Label ID="Label12" runat="server" Text="Assunto"></asp:Label>
<asp:TextBox ID="tbAssunto" CssClass="radiusInput" runat="server"
MaxLength="200" Width="880px" Height="32px">
</asp:TextBox>
<br />
<asp:TextBox runat="server" CssClass="radiusInput" ID="lbltotalcount" Height="32px"
Enabled="false"></asp:TextBox>
<asp:Button ID="btnCarregar" runat="server" Text="Carregar" OnClick="btnCarregar_Click" />
<br />
<br />
<div class="jumbotron">
<h1>Carregamento de Conteúdo HTML do Arquivo anexo.</h1>
</div>
<div runat="server" id="conteudo" />
<asp:Panel runat="server" ID="pnlShowData" Visible="True">
<%--<h1>Filtro dos Contatos Cadastrados</h1>--%>
<asp:GridView ID="gwDados" runat="server" AutoGenerateColumns="False" EmptyDataText="Não Existem Contatos neste filtro..."
PageSize="10000" PagerSettings-PageButtonCount="10000" AllowPaging="True" OnPageIndexChanging="gwDados_PageIndexChanging">
<Columns>
<asp:BoundField DataField="CODIGO" HeaderText="" FooterStyle-BackColor="White"
ItemStyle-ForeColor="White" HeaderStyle-BackColor="White" ItemStyle-BorderColor="White"/>
<asp:BoundField DataField="RAZAO" HeaderText="" FooterStyle-BackColor="White"
ItemStyle-ForeColor="White" HeaderStyle-BackColor="White" ItemStyle-BorderColor="White"/>
<asp:BoundField DataField="EMAIL" HeaderText="" FooterStyle-BackColor="White"
ItemStyle-ForeColor="White" HeaderStyle-BackColor="White" ItemStyle-BorderColor="White" />
</Columns>
<PagerSettings FirstPageText="First" LastPageText="Last" Mode="NumericFirstLast" PageButtonCount="4" />
</asp:GridView>
</asp:Panel>
-
Bom dia,
Você precisa colocar esses código dentro do form
<form runat="server"></form>
- Marcado como Resposta Thales F Quintas quinta-feira, 2 de junho de 2016 12:20