[CLOSED] ResourceManager causes excpetion

  1. #1

    [CLOSED] ResourceManager causes excpetion

    Hi,
    the following code works great without the ResourceManager. If i add the ResourceManager i get the following Excpetion:
    The Controls collection cannot be modified because the control contains code blocks (i.e. <% ... %>).
    <%@ Page Language="C#" %>
    
    <%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
    
    <script runat="server">
        public class MyConfig
        {
            public const int Value = 1;
        }
    </script>
    
    <!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>
        <script type="text/javascript">
            var x = <%= MyConfig.Value %>;
    
        </script>
    </head>
    <body>
    
        <ext:ResourceManager ID="ResourceManager" runat="server" ScriptMode="Debug" />
    
    </body>
    </html>
    Last edited by Daniil; Nov 11, 2010 at 9:08 AM. Reason: [CLOSED]
  2. #2
    Hi,

    This exception is not specific to Ext.NET. It's a general ASP.NET limitation. Lots of information regarding this exception is available on the web.

    Here's a few to start with.

    http://www.google.com/search?q=The+C...ns+code+blocks

    Hope this helps.
  3. #3
    I will check. Thanks ;)

    But why removing the ResourceManager the code works?
  4. #4
    Try moving the ResourceManager to the <head> section, before the script tag?
  5. #5
    OK. I read and able to unserstand/fix the issue.
    Thanks :)
  6. #6
    Hi,

    Something I noticed about your code sample, you should add the runat="server" attribute to your <head> tag.

    Example

    <head runat="server">
    That will not solve the Exception problem, but it might help prevent some other issues from occurring.
    Geoffrey McGill
    Founder

Similar Threads

  1. [CLOSED] ResourceManager + ExtJs
    By PoloTheMonk in forum 1.x Legacy Premium Help
    Replies: 3
    Last Post: Jun 21, 2012, 9:46 PM
  2. [CLOSED] [1.0] Bug ResourceManager.RegisterLocale
    By drgw74 in forum 1.x Legacy Premium Help
    Replies: 3
    Last Post: Jan 21, 2011, 12:56 PM
  3. [CLOSED] bug in ResourceManager.ApplicationName
    By pil0t in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Sep 17, 2010, 3:09 PM
  4. [CLOSED] [1.0] AJAX and ResourceManager Help
    By Timothy in forum 1.x Legacy Premium Help
    Replies: 30
    Last Post: Jan 23, 2010, 2:08 PM
  5. [CLOSED] [1.0] ResourceManager issue
    By randy85253 in forum 1.x Legacy Premium Help
    Replies: 6
    Last Post: Oct 29, 2009, 11:45 AM

Tags for this Thread

Posting Permissions