Click here to Skip to main content
15,893,486 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi,

I am new to MVC framework.
I am working one application.
I have an one controller class in that i have stored one value in session .
now i want to retrive session value on other model class to pass as parameter to sql query.

Pls help

Thanks
Posted
Comments
Nelek 27-Sep-13 11:06am    
You got one answer, I don't know if it is what you were looking for, but for future ocassions it would be nice that you read:
What have you tried?[^]
So you can formulate your question in a better way.

1 solution

in one of your controller methods do a

var myval = HttpContext.Current.Session["MyValue"];


["MyValue"] // is the key of the item you want to use.


then pass this myval object to the class which you want to use it in.
 
Share this answer
 

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