It is possible to get access to the values in the Request.QueryString and Request.Form collections with:

@System.Web.HttpContext.Current.Request.QueryString["ID"] @System.Web.HttpContext.Current.Request.Form["ID"]

The values can be used to build URL's or in a javascript to perform client based tasks based on querystring values.


The key should always be in lowercase no matter what the casing in the URL is. 

Often you need to act on querystring values, like here the groupid. You will need to add a @using System.Web as HttpContext lives in that class:

@using System.Web @{ var request = HttpContext.Current.Request; var response = HttpContext.Current.Response; <h1>GroupID: @request["groupid"]</h1> }

You might want to use the Dynamicweb.Base class to convert the requested value to a string:

@using Dynamicweb; ... var currentGroupId = Dynamicweb.Base.ChkString(request["groupid"]);

The following example illustrates how to use the Server.Request tag in HTML. In this case how to use it in a template given the URL http://doc.dynamicweb-cms.com/Default.aspx?ID=904&q=dynamicweb:

<!--@If Defined(Server:Request.q)--> You searched for "<!--@Server:Request.q-->"...: <!--@EndIf(Server:Request.q)-->