strange behaviour of static method
        Posted  
        
            by Cristian Boariu
        on Stack Overflow
        
        See other posts from Stack Overflow
        
            or by Cristian Boariu
        
        
        
        Published on 2010-05-07T19:42:58Z
        Indexed on 
            2010/05/07
            19:48 UTC
        
        
        Read the original article
        Hit count: 232
        
Hi, I load a js variable like this:
var message = '<%= CAnunturi.CPLATA_RAMBURS_INFO %>';
where the static string CPLATA_RAMBURS_INFO i put like:
public static string CPLATA_RAMBURS_INFO = "test";
I use it very well in this method.
 <script type="text/javascript">
    var categoryParam = '<%= CQueryStringParameters.CATEGORY %>';
    var subcategoryParam = '<%= CQueryStringParameters.SUBCATEGORY1_ID %>';
    var message = '<%= CAnunturi.CPLATA_RAMBURS_INFO %>';
    function timedInfo(header) {
        $.jGrowl(message, { header: header });
    };
</script>
so the message appears.
I do not undersand, why, iso of "test", if i take the value from a static method, ths use of message js var is no longer succesfull (the message no longer appears).
public static string CPLATA_RAMBURS_INFO = getRambursInfo();
    public static string getRambursInfo()
    {
       return System.IO.File.ReadAllText(PathsUtil.getRambursPlataFilePath());
    }
Any help would be highly appreciated....
© Stack Overflow or respective owner