Web.config

  1. #1

    Web.config

    Could you post a quick example Web.config that shows where the changes for ScriptManager would go? Thanks.
  2. #2

    RE: Web.config

    Hi swallace,

    Sure thing. The Ajaxian/ExtJS blog posts caught us a bit off guard. We were hoping to have one more day to complete a few of the critical tutorials. I'll have a full Web.config Example/tutorial available within the next few hours.
    Geoffrey McGill
    Founder
  3. #3

    RE: Web.config

    Hi swallace,

    The following code demonstrates where to add the global "coolite" configSection to the Web.config. Each of the properties/attributes are listed with a bit of description, optional values and default values.</p>

    <?xml version="1.0"?></p>
    
    <configuration>
    *** <configSections>
    ***** <section name="coolite" type="Coolite.Ext.Web.GlobalConfig"/>
    *** </configSections></p>
    
    * <!-- COOLITE GLOBAL CONFIGURATION ATTRIBUTES -->
    * <!-- cleanResourceUrl = true|false 
    ****** The Coolite controls can clean up the autogenerate WebResource Url so they look presentable. 
    ****** Default is true -->
    * 
    * <!-- gzip = true|false 
    ****** Whether to automatically render scripts with gzip compression. 
    ****** Default is true. -->
    * 
    * <!-- scriptAdapter = Ext, jQuery, Prototype, YUI 
    ****** Which script adapter to use. 
    ****** Default is "Ext" -->
    * 
    * <!-- renderScripts = true|false 
    ****** Whether to have the coolite controls output the required JavaScript includes or not.
    ****** Gives developer option of manually including required <script> files. 
    ****** Default is true -->
    * 
    * <!-- renderStyles = true|false 
    ****** Whether to have the coolite controls output the required StyleSheet includes or not.
    ****** Gives developer option of manually including required <link>/<style> files.
    ****** Default is true -->
    * 
    * <!-- scriptMode = Release, Debug 
    ****** Whether to include the Release (condensed) or Debug (with documentation) JavaScript files
    ****** Default is "release" -->
    * 
    * <!-- theme = Default, Gray 
    ****** Which embedded theme to use.
    ****** Default is "Default" --></p>
    
    * <coolite
    *** cleanResourceUrl="true"
    *** gzip="true"
    *** scriptAdapter="Ext" 
    *** renderScripts="true"
    *** renderStyles="true"
    *** scriptMode="Release"
    *** theme="Gray"
    *** /></p>
    
    </configuration>
    </p>

    The Theme can also be set at a Session level by using the ScriptManager.RegisterSessionTheme() method or directly by setting the "Coolite.Theme" Session value. Setting the Theme in the Session will override a Theme set in the Web.config. </p>

    Example</p>

    <script runat="server">
    *** protected void Page_Load(object sender, EventArgs e)
    *** {
    ******* Coolite.Web.UI.ScriptManager.RegisterSessionTheme(Coolite.Web.UI.Theme.Gray);
    *** }
    </script>
    <script runat="server">
    *** protected void Page_Load(object sender, EventArgs e)
    *** {
    ******* HttpContext.Current.Session["Coolite.Theme"] = Coolite.Web.UI.Theme.Gray;
    *** }
    </script>
    </p>


    I have a detailed tutorial and screencast in the works, but they're not quite done. I'll update this thread once they're ready.</p>

    Hope this helps.</p>
    Geoffrey McGill
    Founder
  4. #4

    RE: Web.config

    Perfect, thanks!
  5. #5

    RE: Web.config

    Looks like the sample is from an earlier/later version than the 0.3.1.12579 that I'm using.

    Here's a change that makes it work:

    renderScripts="Embedded"
    renderStyles="Embedded"

    As given, the example produces the error:

    The value of the property 'renderScripts' cannot be parsed. The error is: The enumeration value must be one of the following: None, File, Embedded.
  6. #6

    RE: Web.config

    Right you are regarding the renderScripts and renderStyles properties. That was my mistake. Both take a ResourceLocationType Enum value with possible options being Embedded, File or None.

    Here's the updated Web.config sample.
    <?xml version="1.0"?>
    
    <configuration>
        <configSections>
          <section name="coolite" type="Coolite.Web.UI.GlobalConfig"/>
        </configSections>
    
      <!-- COOLITE GLOBAL CONFIGURATION ATTRIBUTES -->
      <!-- cleanResourceUrl = true|false 
           The Coolite controls can clean up the autogenerate WebResource Url so they look presentable. 
           Default is true -->
      
      <!-- gzip = true|false 
           Whether to automatically render scripts with gzip compression. 
           Only works when renderScripts="Embedded" and/or renderStyles="Embedded".
           Default is true. -->
      
      <!-- scriptAdapter = Ext, jQuery, Prototype, YUI 
           Which script adapter to use. 
           Default is "Ext" -->
      
      <!-- renderScripts = Embedded, File, None
           Whether to have the coolite controls output the required JavaScript includes or not.
           Gives developer option of manually including required <script> files. 
           Default is Embedded -->
      
      <!-- renderStyles = Embedded, File, None
           Whether to have the coolite controls output the required StyleSheet includes or not.
           Gives developer option of manually including required <link> or <style> files.
           Default is Embedded -->
      
      <!-- scriptMode = Release, Debug 
           Whether to include the Release (condensed) or Debug (with imline documentation) Ext JavaScript files.
           Default is "Release" -->
      
      <!-- theme = Default, Gray 
           Which embedded theme to use.
           Default is "Default" -->
    
      <coolite
        cleanResourceUrl="true"
        gzip="true"
        scriptAdapter="Ext" 
        renderScripts="true"
        renderStyles="true"
        scriptMode="Release"
        theme="Gray"
        />
    
    </configuration>

    Hope this helps.
    Geoffrey McGill
    Founder
  7. #7

    RE: Web.config



    We found a couple problems when running the Assembly in Medium Trust mode. One was fixed in code and will be available with the next release. The other requires a simple edit to the web.config.

    The <code>requirePermission="false"</code> attribute must be applied to the coolite configuration section.

    Here's the full revised web.config sample.

    <?xml version="1.0"?>
    <configuration>
    * <configSections>
    *** <section name="coolite" type="Coolite.Ext.Web.GlobalConfig" requirePermission="false" />
    * </configSections>
    * <!-- COOLITE GLOBAL CONFIGURATION ATTRIBUTES -->
    * <!-- cleanResourceUrl = true|false******* 
    ****** The Coolite controls can clean up the autogenerate WebResource Url so they look presentable.******* 
    ****** Default is true -->
    * 
    * <!-- gzip = true|false******* 
    ****** Whether to automatically render scripts with gzip compression.******* 
    ****** Only works when renderScripts="Embedded" and/or renderStyles="Embedded".****** 
    ****** Default is true. -->
    * 
    * <!-- scriptAdapter = Ext|jQuery|Prototype|YUI******* 
    ****** Which script adapter to use.******* 
    ****** Default is "Ext" -->
    * 
    * <!-- renderScripts = Embedded|File|None****** 
    ****** Whether to have the coolite controls output the required JavaScript includes or not.****** 
    ****** Gives developer option of manually including required <script> files.******* 
    ****** Default is Embedded -->
    * 
    * <!-- renderStyles = Embedded|File|None****** 
    ****** Whether to have the coolite controls output the required StyleSheet includes or not.****** 
    ****** Gives developer option of manually including required <link> or <style> files.****** 
    ****** Default is Embedded -->
    * 
    * <!-- scriptMode = Release|Debug******* 
    ****** Whether to include the Release (condensed) or Debug (with inline documentation) Ext JavaScript files.****** 
    ****** Default is "Release" -->
    * 
    * <!-- theme = Default|Gray******* 
    ****** Which embedded theme to use.****** 
    ****** Default is "Default" -->
    * 
    * <coolite*** 
    ***** cleanResourceUrl="true"*** 
    ***** gzip="true"*** 
    ***** scriptAdapter="Ext"**** 
    ***** renderScripts="true"*** 
    ***** renderStyles="true"*** 
    ***** scriptMode="Release"*** 
    ***** theme="Gray"*** 
    ***** />
    </configuration>
    You can switch into Medium Trust mode to test by adding adding the following <trust> node to your web.config, within the <system.web> node.

    <system.web>
    *** <trust level="Medium" />
    </system.web>
    </p>
    Geoffrey McGill
    Founder
  8. #8

    RE: Web.config

    As of version 0.4.1, we've added several other options for setting each of these global config properties. The following forum post details each of the four methods.

    http://forums.ext.net/showthread.php?postid=177.aspx

    As well, a new global config property called ResourcePath was added. More information available within the following forum post.

    http://forums.ext.net/showthread.php?postid=178.aspx

    Hope this helps.
    Geoffrey McGill
    Founder
  9. #9

    RE: Web.config

    hi,geoffrey

    How to change the custom theme by Ajax methods or Ajax events?
  10. #10

    RE: Web.config

    Hi jachnicky,

    It's probably best to start a new thread since your question is a new topic. thx.


    Geoffrey McGill
    Founder

Similar Threads

  1. [CLOSED] About Web.config
    By showingg in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: May 14, 2012, 7:22 AM
  2. Replies: 1
    Last Post: Dec 23, 2010, 4:35 AM
  3. web.config for version 1.0
    By thchuong in forum 1.x Help
    Replies: 4
    Last Post: Apr 19, 2010, 6:05 AM
  4. [CLOSED] web.config error
    By x1000 in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Feb 25, 2010, 12:54 AM
  5. config item condition
    By [WP]joju in forum 1.x Help
    Replies: 5
    Last Post: Sep 25, 2009, 1:00 AM

Posting Permissions