[CLOSED] Accessing ASP.NET Global resources from ext:XScript

  1. #1

    [CLOSED] Accessing ASP.NET Global resources from ext:XScript

    Hi,
    I'm trying to access to the asp.net global resources from an ext.net xscript.

    If I put the:

    <%$  Resources:Global, message %>
    inside the XScript code this is not processed, so I thought to put this in an ext:hidden and then access to it from the XScript.. and it doesn't work.

    Any other ideas? Is there a way on ext.net to access to global resourses also from the ext:xscript in an easy and clean way?

    Thanks for your time.

    Have a good day.
    Last edited by Daniil; Feb 25, 2014 at 8:38 AM. Reason: [CLOSED]
  2. #2
    Hi @John_Writers,

    Maybe something like this.

    Example
    <%@ Page Language="C#" %>
    
    <%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
    
    <!DOCTYPE html>
    <html>
    <head runat="server">
        <title>Ext.NET v2 Example</title>
    
        <script>
            var msg = <asp:Literal runat="server" Text="<%$ Resources:Global, message%>" />;
        </script>
    
        <ext:XScript runat="server">
            <script>
                var onClick = function () {
                    alert(msg);
                };
            </script>
        </ext:XScript>
    </head>
    <body>
        <form runat="server">
            <ext:ResourceManager runat="server" />
            <ext:Button runat="server" Text="Click me" Handler="onClick" />
        </form>
    </body>
    </html>
  3. #3
    Perfect!

    It works like a charm.

    Thank you for your time.

    Have a good day!

Similar Threads

  1. [CLOSED] How to use Xscript in Razor engine
    By alscg in forum 2.x Legacy Premium Help
    Replies: 1
    Last Post: Mar 19, 2013, 5:25 AM
  2. Replies: 0
    Last Post: Dec 05, 2012, 8:22 PM
  3. [CLOSED] XScript primer?
    By vadym.f in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Aug 02, 2012, 1:22 PM
  4. [CLOSED] Global Resources in DirectEvent Beforehandler
    By ljankowski in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Feb 27, 2012, 8:49 PM
  5. [CLOSED] Xscript
    By jeybonnet in forum 1.x Legacy Premium Help
    Replies: 3
    Last Post: Jan 19, 2011, 8:27 PM

Posting Permissions