Developer forum

Forum » Templates » Query String in Razor

Query String in Razor

Yasharth Tahiliani
Reply

Hi,

Is there a way to get the query string value within a Dynamic Web Razor template?

I am trying the following : 

@{
    string brochureName = @Request.QueryString["brochureName"];
}

but it isn't working.


Replies

 
Ben Doorn
Reply

This should work.

@{

string brochureName = System.Web.HttpContext.Current.Request.QueryString["brochureName"];

}

 

 
Yasharth Tahiliani
Reply

Thank you so much!

 

You must be logged in to post in the forum