Developer forum

Forum » Templates » Razor: Global:Pageview.Url.Raw.JSEncoded()

Razor: Global:Pageview.Url.Raw.JSEncoded()

Mikkel Ulstrup
Reply

Hi,

In the old html templates, we had this tag <!--@Global:Pageview.Url.Raw.JSEncoded()-->.

How do I access this in razor? - Or anything that gives a similar value.

Thanks!

- Mikkel


Replies

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

.JSEncode() is a HTML template extension tag.

The Razor template is C# - so you can use normal .NET: https://msdn.microsoft.com/en-us/library/dd991914%28v=vs.110%29.aspx

Votes for this answer: 1
 
Mikkel Ulstrup
Reply

Thank you!

Used the following:

@HttpUtility.JavaScriptStringEncode(HttpContext.Current.Request.RawUrl)

 

You must be logged in to post in the forum