Click here to Skip to main content
16,021,181 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I am setting menu Items in XML from a master page and accessing that Using a Session.

In Client Side script, that Session i am assigning to a java script variable like the below

JavaScript
var myMenuForGoButton = <%= Session["xyz"]%>; 


If i am giving single quotes for that Session, i am not able to access Menu items, If not giving i am able to access. but it is popping me a Syntax error.
Posted

1 solution

use this
var myMenuForGoButton ="<%=Session["xyz"]%>" ;

amit jamwal
 
Share this answer
 
Comments
Samsi Y 10-Jul-12 3:08am    
If i am using it, Session contains a Search Box which is not able to search anything.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900