Vulnerability in EPiServer.Forms
You can try Request.RequestContext.GetContentLink(). that should get you what you are after.
Normally you pass along the values you need in the viewmodel. So expanding the viewmodel with what you need in the view / layout should be your first bet.
Storing it in viewbag is an alternative, don't like that one much. I'm a bit old school. If you are using Alloy variant of viewmodels you will also get the current page as part of your viewmodel...
Thank you Joshua, thats exactly what i need
Live Daniel said though, normally i onl use request.requestcontext.getcontentlink when i don't have it available on the model which is hardly every or in a block and need to know what page I am on. Hope that makes sense. you should be sending at least a viewmodel to the view if you are not comfortable sending the full pagedata model to the view.