Login with  Log in with facebook
Hiring Manager? SIGN UP HERE
4

I have GenericPagecontroller in my project which renders GenericPage.aspx. There are links in the homepage and in two other pages for this GenericPageconroller.Now based on from where it is invoked, i have diiferent data to pass in to the GenericPage.aspx. ie If the Controller is requested from HomePage i have different set of data to show in the view and if it from other page i need to display diiferent set of data in the view. As of now i have kept an optional parameter in the Index method (the default method in GenericController) and added a querystring in the URL which holds the current page's name. Thus from the paramter i find from which link the request comes and load the appropriate data into the view.

Is there any way to achieve this instead having a querystring which carries the related information...? some way to dynamically to find this ?

 

Dewasish Mitruka
07/08/2011 at 03:58
1 Answer
1
3
1 down vote accepted

 

you can check Request.UrlReferrer which contains the referring page.

This method is not 100% reliable however.

 

Dewasish Mitruka
07/08/2011 at 03:58

If you want to post any answer to this forum then you need to log in.
Schedule a Demo

Schedule a Demo with us

Name *
Email *
Phone *
Company *
Details