Asked by:
Retrieve URL from user control

Question
-
User-1526035670 posted
Hi
I have a web user control on a nested page such as
Http://example.com/companyname/landing/results.aspx
Companyname is a placeholder and is the actual name of the company.
The control is placed on the results page. I'm trying to get the URL where the company name is whatever company the user is viewing plus landing/results?c=1.
The results I've had are a range of duplicate URL, missing parent directory and so forth.
Can't anyone guide me in achieving this?
Thanks in advanceMonday, April 6, 2020 8:24 PM
All replies
-
User475983607 posted
We'll need a lot more information. A user control has nothing to do with Identifying a user or a user's company. A user control is just a bit of reusable code that loads when the main page loads. Can you explain how your application works and provide sample code that illustrates the problem?
Monday, April 6, 2020 8:47 PM -
User-1526035670 posted
Hi
So on my results page is the user control containing a hyperlink.
HL.NavigsteUrl = string.format("/results.aspx?c={0}", c.is);
This didn't work I think it showed http://example.com/result?c=1 when I was expecting the current URL at the parameter passed in.Monday, April 6, 2020 9:04 PM -
User475983607 posted
So on my results page is the user control containing a hyperlink.
HL.NavigsteUrl = string.format("/results.aspx?c={0}", c.is);
This didn't work I think it showed http://example.com/result?c=1 when I was expecting the current URL at the parameter passed in.Your response does not clarify the problem you are trying to solve. You think it showed? Or it did show? What URL do you expect?
Monday, April 6, 2020 9:13 PM -
User409696431 posted
JamieP1
Hi=1
HL.NavigsteUrl = string.format("/results.aspx?c={0}", c.is);
This didn't work I think it showed http://example.com/result?c=1 when I was expecting the current URL at the parameter passed in.What do you mean "you were expecting the current URL at the parameter passed in"? What is "c.is"? I assume it evaluates to "1" if you get the result http://example.com/result?c=1, and if so, that is exactly what you told it to be.
What else did you expect it to be, and why? If you wanted the "landing" to be included, add it: string.format("/landing/results.aspx?c={0}", c.is)
Monday, April 6, 2020 10:20 PM