SF Developer
SF Developer

Reputation: 5384

MVC - how do I know on what page I am (both at Client and Server level)?

Imagine i have a control (or partial view) that needs to display differently depending on what page it is.

How can I know both at the Server and Client level on what page I am?

Upvotes: 0

Views: 69

Answers (1)

ten5peed
ten5peed

Reputation: 15890

On the server (ASP.NET & MVC):

Request.Url

On the client using Javascript:

window.location

Upvotes: 1

Related Questions