I basically want to set it up so that if the user is on page A, the link's going to point here and say this. If on page B, the link's going to point somewhere else and say something else.
I initially started using: Request.ServerVariables["SCRIPT_NAME"]
but that only gives you the filename, not the information about what data was selected (i.e. I need the full url path).
Anyhow, I switched to using "Request.UrlReferrer.AbsoluteUri.ToString()", but can't seem to get it to work either, as it keeps going to the default value. Am I just not putting the url in the right form? I have three different forms in the code, so I could eliminate some possibilities.
Any thoughts? Thanks in advance! :)
Expand|Select|Wrap|Line Numbers
- if(Request.UrlReferrer.AbsoluteUri != null)
- {
- switch(Request.UrlReferrer.AbsoluteUri.ToString())
- {
- case "/TitleList.aspx":
- lnkto.NavigateUrl = "http://dev.xxxxxx.com/TitleList.aspx?searchType=5&CategoryPrefer=movies&searchText=&category=New%20Movie%20Arrivals";
- lblto.Text = "View Silly Movies";
- break;
- case "/TitleList.aspx?searchType=3&searchText=&CategoryID=1170&Category=Featured%20Content":
- lnkto.NavigateUrl = "http://dev.xxxxxx.com/TitleList.aspx?searchType=6&searchText=&CategoryPrefer=tv&category=New%20TV%20Arrivals";
- lblto.Text = "View All TV";
- break;
- case "http://dev.xxxxxx.com/TitleList.aspx?searchType=7&searchText=&CategoryID=1180&Category=Featured%20Content":
- lnkto.NavigateUrl ="http://dev.xxxxxx.com/TitleList.aspx?searchType=7&searchText=&CategoryPrefer=tv&category=All";
- lblto.Text = "View All Trailers";
- break;
- default: lnkto.NavigateUrl ="http://dev.xxxxxx.com/TitleList.aspx?searchType=7&searchText=&CategoryPrefer=tv&category=All";
- lblto.Text = "View All Content";
- break;
- }
- }