views:

29

answers:

1

Hi All

I want to show a Session Variable data on View. How can i achieve it. I am storing some data in Session varaibles and noew i want to display it on View please help me.

I am new Asp.Net MVC 2

Please suggest.

+3  A: 

use the ViewData and pass it to the view

in your controller set up something like ViewData["namehere"] = value

then in your View you can call the value of Viewdata["name here"] - think of the ViewData as a bag that you can put properties and their values into and not need to explicitly pass the viewdata to the view for the view to use it

PaulStack