Click here to Skip to main content
12,449,325 members (59,182 online)
Rate this:
 
Please Sign up or sign in to vote.
See more: jQuery
Hi,
In my ASP project, created a Session Variable and assigned a Value in a asp page.
<%
Session("name")="Mike"
%>
I have to get this session "name" value in the another html file (.htm) thru Jquery (Javascript). Using IE 6.0 version(Browser). Is it possible or is anyother way to solve this?. Waiting for your replies.
Posted 20-Feb-13 10:51am
Jvelu213
Updated 20-Feb-13 11:17am
v2
Comments
   
If you want to add ajax to the problem, then yes. Check this link: http://stackoverflow.com/questions/9650930/how-to-update-session-variable-with-jquery-ajax-is-it-even-possible
   
Get session variable with JQuery

http://forums.asp.net/t/1623703.aspx/1

1 solution

Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 1

use this code may be i'll help you

function abc()
{
var testUser = '<%= Session["User"] %>';
alert(testUser);
}
  Permalink  
Comments
Tharaka MTR 23-Feb-13 3:38am
   
this is wrong you can't use the server side variable with .html page.
bkthebest 23-Feb-13 4:01am
   
do correct yourself

i am using this code in my application and it is working perfectly
KryptoMandi 25-Apr-14 4:49am
   
on an HTML page the alert outputs '<%= Session["User"] %>' on an aspx page it get gets the user

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

  Print Answers RSS
Top Experts
Last 24hrsThis month


Advertise | Privacy | Mobile
Web01 | 2.8.160811.3 | Last Updated 23 Feb 2013
Copyright © CodeProject, 1999-2016
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100