Developer forum

Forum » Templates » Get QS with razor

Get QS with razor

Kasper Skov
Reply

I get the error: The name 'HttpContext' does not exist in the current context

with HttpContext.Current.Request.QueryString["querystringname"].

I've tried with GetValue("Server:Request.querystringname") also. Nothing.

What am I doing wrong?


Replies

 
Nicolai Høeg Pedersen
Reply
This post has been marked as an answer

Hi Kasper

Remember to import System.Web where HttpContext resides. Or write System.Web.HttpContext.Current.Request.QueryString["querystringname"].

Nicolai

Votes for this answer: 1
 
Kasper Skov
Reply

Right ofcourse. Resharper you fail me once again :)

 

You must be logged in to post in the forum