Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
Hi guys,
 
Can you please help me? i've been working this for a couple of days, yet can't solve it. I have Dropdownlist, is it possible that everytime i select dropdownlist it will create a session thru javascript. it will overwrite the current value after i select item on dropdownlist. with no button intervention.. is that possible? please help.. i'm using MVC3 (c#). please guide me.. thanks.
 
regards,
-naijeru-
Posted 23-Sep-12 18:28pm
naijeru542
Edited 23-Sep-12 18:29pm
v2
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

var myvar = "Hey Buddy";
 
    '<%Session["temp"] = "' + myvar +'"; %>' ;
 
    alert('<%=Session["temp"] %>');
 
Does this really work?  the javascript is executing on the client side.
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

I think you misunderstood the concept of session. Session is a server side per-user-data-store which allows you to save user data on the server side. You can store and read string information in a cookie. Just try storing value in the cookie and in page load only find the cookie(if exists) and replace the session value.
 

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

Solution 3

Quote:
To hiredotnet,
 
thanks.. i'll it.

Quote:
To _Amy,
 
maybe i misunderstood.. Big Grin | :-D actually i use that one because i need the value of dropdownlist later on next page..
  Permalink  

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



Advertise | Privacy | Mobile
Web02 | 2.8.1411022.1 | Last Updated 24 Sep 2012
Copyright © CodeProject, 1999-2014
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