Obtain the pathName dinamically for ASP.NET MVC
Posted
by vikitor
on Stack Overflow
See other posts from Stack Overflow
or by vikitor
Published on 2010-04-28T11:53:58Z
Indexed on
2010/04/28
12:03 UTC
Read the original article
Hit count: 270
asp.net-mvc
|partial-views
Hello, I'm looking for a solution that allows me to get the parent page pathname from a partialView invoked. For example I have an Action baa and a controller boo so the javascript to obtain this will be window.location.pathname, and it returns /boo/baa.
The thing is that I use a partial view, so when I try to retrieve the pathname via the URL helper, what I obtain is the PartialView one, and what I need is the pathname for the action that invokes it. I want to do this because I want to show certain things of the partial view depending on the pathname of the parent view that invokes it. Is there a way to do this with ASP.NET MVC?
Thank you all in advance,
© Stack Overflow or respective owner