Вот так:
<%
string rl = Request.RawUrl;
%>
или в вашем конкретном случае:
<script type="text/C#" runat="server">
string rl = HttpContext.Current.Request.RawUrl;
</script>
UPDATE:
Согласно вашему комментарию вы хотите использовать эту переменную везде. В этом случае я бы порекомендовал вам написать собственный помощник, который будет доступен во всех видах:
public static class HtmlExtensions
{
public static string GetSomeValue(this HtmlHelper htmlHelper)
{
var context = htmlHelper.ViewContext.RequestContext.HttpContext;
var value = context.Items["__some_key__"] as string;
if (value != null)
{
// the value was found in the HTTP context => no need
// to recalculate it
return value;
}
value = ... do some expensive calculation to fetch the value
// store the value in the HTTP context so that the next time
// someone calls this helper from within the current HTTP context
// doesn't need to perform the expensive operation
context.Items["__some_key__"] = value;
return value;
}
}
и затем, когда вам нужно где-то значение:
<%= Html.GetSomeValue() %>