Reputation: 85
While making an ajax request to a Controller action I'm trying to get the url of the page from which the ajax request is being triggered.
Using Request.RawUrl in the action is returning the ajax request url as the current request in ajax request. Is there any way to know the actual url of the page from which the ajax request is being triggered.
Upvotes: 0
Views: 608
Reputation: 29186
In your controller method use
This should give you the url of the ajax request's origin.
Upvotes: 1