How do I add session variable to view markup?

时间:2015-07-31 19:30:45

标签: asp.net-mvc vb.net session razor

I am trying to add a session variable to html markup using MVC Razor, I tried this:

<div class="panel-body">
<p>It might suprise you to know that you can upgrade from @Session("CurrentProvider") to blah blah....</p>
</div>

I tried wrapping it in code tags and all sorts. How can I fix this?

1 个答案:

答案 0 :(得分:0)

Seems the answer is to append with ToString

@Session("CurrentProvider").ToString