1. Este site usa cookies. Ao continuar a usar este site está a concordar com o nosso uso de cookies. Saber Mais.

ajax error

Discussão em 'Web Development' iniciada por alfinete, 27 de Maio de 2009. (Respostas: 1; Visualizações: 1084)

  1. alfinete

    alfinete Power Member

    estou em asp.net ajax no qual tenho o erro mais a frente discrito

    code de ajax no ascx

    Código:
    <%@ Control Language="C#" AutoEventWireup="true" Codebehind="wucDNVTTabProcessHistory.ascx.cs"
        Inherits="StepAhead.Web.DNVTProcessHistory.DNVTProcessHistoryWuControl.wucTabProcessHistory" %>
    <%@ Register Assembly="AjaxControlToolkit, Version=1.0.20229.20821, Culture=neutral, PublicKeyToken=28f01b0e84b6d53e"
        Namespace="AjaxControlToolkit" TagPrefix="cc2" %>
    <table class="SACTable">
        <tr>
            <td>
               <cc2:DropDownExtender runat="server" ID="ddl" ></cc2:DropDownExtender> 
            </td>
        </tr>
    </table>
    
    

    code do aspx que chama o ascx acima


    Código:
    <%@ Page Language="C#" MasterPageFile="~/SACMasterPage.Master" AutoEventWireup="true" CodeBehind="DNVTabProcessHistory.aspx.cs" Inherits="StepAhead.Web.DNVTProcessHistory.DNVTabProcessHistory" Title="Untitled Page" %>
    
    <%@ Register Src="DNVTProcessHistoryWuControl/wucDNVTTabProcessHistory.ascx" TagName="wucDNVTTabProcessHistory"
        TagPrefix="uc1" %>
    
    
    
    
    
    
    <asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
        <uc1:wucDNVTTabProcessHistory ID="WucDNVTTabProcessHistory1" runat="server" />
      
    </asp:Content>
    
    Erro

    ____________________
    Código:
    
    The Controls collection cannot be modified because the control contains code blocks (i.e. <% ... %>).          body {font-family:"Verdana";font-weight:normal;font-size: .7em;color:black;}           p {font-family:"Verdana";font-weight:normal;color:black;margin-top: -5px}          b {font-family:"Verdana";font-weight:bold;color:black;margin-top: -5px}          H1 { font-family:"Verdana";font-weight:normal;font-size:18pt;color:red }          H2 { font-family:"Verdana";font-weight:normal;font-size:14pt;color:maroon }          pre {font-family:"Lucida Console";font-size: .9em}          .marker {font-weight: bold; color: black;text-decoration: none;}          .version {color: gray;}          .error {margin-bottom: 10px;}          .expandable { text-decoration:underline; font-weight:bold; color:navy; cursor:hand; }         [B][I]The Controls collection cannot be modified because the control contains  code blocks (i.e. <% ... %>).[/I] [/B]
    
    [FONT=Arial, Helvetica, Geneva, SunSans-Regular, sans-serif][B]Description:  [/B]An unhandled exception occurred during the execution of the current web  request. Please review the stack trace for more information about the error and  where it originated in the code. 
    
    [B]Exception Details:  [/B]System.Web.HttpException: The Controls collection cannot be modified because  the control contains code blocks (i.e. <% ... %>).
    
    [B]Source  Error:[/B] 
    
       [COLOR=Black]An unhandled exception was generated during the execution of the  current web request. Information regarding the origin and location of the  exception can be identified using the exception stack trace below.[/COLOR]  
    [B]Stack Trace:[/B] 
    
       [COLOR=Black][HttpException (0x80004005): The Controls collection cannot be modified because the control contains code blocks (i.e. <% ... %>).]
       System.Web.UI.ControlCollection.Add(Control child) +2108047
       AjaxControlToolkit.ScriptObjectBuilder.RegisterCssReferences(Control control) +654
       AjaxControlToolkit.ExtenderControlBase.OnLoad(EventArgs e) +50
       System.Web.UI.Control.LoadRecursive() +47
       System.Web.UI.Control.LoadRecursive() +131
       System.Web.UI.Control.LoadRecursive() +131
       System.Web.UI.Control.LoadRecursive() +131
       System.Web.UI.Control.LoadRecursive() +131
       System.Web.UI.Control.LoadRecursive() +131
       System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1436
    [/COLOR][/FONT]
    
    web config

    Código:
    <?xml version="1.0"?>
    <configuration>
        <configSections>
            <sectionGroup name="system.web.extensions" type="System.Web.Configuration.SystemWebExtensionsSectionGroup, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35">
                <sectionGroup name="scripting" type="System.Web.Configuration.ScriptingSectionGroup, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35">
                    <section name="scriptResourceHandler" type="System.Web.Configuration.ScriptingScriptResourceHandlerSection, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="false" allowDefinition="MachineToApplication"/>
                    <sectionGroup name="webServices" type="System.Web.Configuration.ScriptingWebServicesSectionGroup, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35">
                        <section name="jsonSerialization" type="System.Web.Configuration.ScriptingJsonSerializationSection, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="false" allowDefinition="Everywhere" />
                        <section name="profileService" type="System.Web.Configuration.ScriptingProfileServiceSection, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="false" allowDefinition="MachineToApplication" />
                        <section name="authenticationService" type="System.Web.Configuration.ScriptingAuthenticationServiceSection, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="false" allowDefinition="MachineToApplication" />
                    </sectionGroup>
                </sectionGroup>
            </sectionGroup>
        </configSections>
        
        <appSettings>
            <!--Begin SAC Template Configurations-->
            <add key="DataSource" value="Server=VM-00; Database=GestaoDNVT; Uid=sa;Pwd=sasasa;"/>
            <add key="DBINUSE" value="SQL2K"/>
            <add key="Services" value="DNVT..FPL7"/>
            <add key="SubChapters" value="DNVT..FPL18"/>
            <add key="Chapters" value="DNVT..FPL17"/>   
       
       <!--End SAC Template Configurations-->
        </appSettings>
      <system.web>
        <sessionState mode="InProc" cookieless="false" timeout="20"/>
    
          <pages validateRequest="false">
              <controls  >
                  <add tagPrefix="asp" namespace="System.Web.UI" assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
              </controls>
          </pages>
    
    
         
          <!--
              Set compilation debug="true" to insert debugging
              symbols into the compiled page. Because this
              affects performance, set this value to true only
              during development.
        -->
         
    
          <httpHandlers>
              <remove verb="*" path="*.asmx"/>
              <add verb="*" path="*.asmx" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
              <add verb="*" path="*_AppService.axd" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
              <add verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" validate="false"/>
          </httpHandlers>
    
          <httpModules>
              <add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
          </httpModules>
          
          
          <!-- 
        //usar esta opção numa Web Farm
        <sessionState mode="StateServer" stateConnectionString="tcpip=localhost:42424" cookieless="false" timeout="20"/>-->
    
        <!-- 
                Set compilation debug="true" to insert debugging 
                symbols into the compiled page. Because this 
                affects performance, set this value to true only 
                during development.
            -->
            <compilation debug="true">
                <assemblies>
                    <add assembly="AjaxControlToolkit, Version=1.0.20229.20821, Culture=neutral, PublicKeyToken=28F01B0E84B6D53E"/>
                    
                    <add assembly="System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
                    <add assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
                    <add assembly="System.Web.Extensions.Design, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
                    <add assembly="System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/></assemblies>
               </compilation>
            <!--
                The <authentication> section enables configuration 
                of the security authentication mode used by 
                ASP.NET to identify an incoming user. 
            -->
            <authentication mode="Windows"/>
            <!--
                The <customErrors> section enables configuration 
                of what to do if/when an unhandled error occurs 
                during the execution of a request. Specifically, 
                it enables developers to configure html error pages 
                to be displayed in place of a error stack trace.
    
            <customErrors mode="RemoteOnly" defaultRedirect="GenericErrorPage.htm">
                <error statusCode="403" redirect="NoAccess.htm" />
                <error statusCode="404" redirect="FileNotFound.htm" />
            </customErrors>
            -->
        </system.web>
    
        <system.web.extensions>
            <scripting>
                <webServices>
                    <!-- Uncomment this line to customize maxJsonLength and add a custom converter -->
                    <!--
          <jsonSerialization maxJsonLength="500">
            <converters>
              <add name="ConvertMe" type="Acme.SubAcme.ConvertMeTypeConverter"/>
            </converters>
          </jsonSerialization>
          -->
                    <!-- Uncomment this line to enable the authentication service. Include requireSSL="true" if appropriate. -->
                    <!--
            <authenticationService enabled="true" requireSSL = "true|false"/>
          -->
    
                    <!-- Uncomment these lines to enable the profile service. To allow profile properties to be retrieved
               and modified in ASP.NET AJAX applications, you need to add each property name to the readAccessProperties and
               writeAccessProperties attributes. -->
                    <!--
          <profileService enabled="true"
                          readAccessProperties="propertyname1,propertyname2"
                          writeAccessProperties="propertyname1,propertyname2" />
          -->
                </webServices>
                <!--
          <scriptResourceHandler enableCompression="true" enableCaching="true" />
          -->
            </scripting>
        </system.web.extensions>
    
        <system.webServer>
            <validation validateIntegratedModeConfiguration="false"/>
            <modules>
                <add name="ScriptModule" preCondition="integratedMode" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
            </modules>
            <handlers>
                <remove name="WebServiceHandlerFactory-Integrated" />
                <add name="ScriptHandlerFactory" verb="*" path="*.asmx" preCondition="integratedMode"
                     type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
                <add name="ScriptHandlerFactoryAppServices" verb="*" path="*_AppService.axd" preCondition="integratedMode"
                     type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
                <add name="ScriptResource" preCondition="integratedMode" verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
            </handlers>
        </system.webServer>
    </configuration>
    
    agradecia uma ajuda
     
  2. alfinete

    alfinete Power Member

Partilhar esta Página