Last post Jul 23, 2008 11:11 AM by pfrumkin
Jul 22, 2008 12:04 PM|pfrumkin|LINK
I just converted some code in a .aspx page to a control (.ascx). Within this page, I have hyperlinks to bookmarks on the same page - these got moved to the control. However, now the bookmark doesn't work. How do you define/assign the NavigateURL property
of a hyperlink to be a bookmark, within a custom control?
Here is the hyperlink control
navigateurl control hyperlink bookmark
Jul 22, 2008 08:15 PM|Peter Bucher|LINK
What means "doesnt work"?
I would say: Make using of the root-operator, supported by ASP.NET.
Jul 23, 2008 11:11 AM|pfrumkin|LINK
Thanks Peter. What I meant by doesn't work is that I would get an exception, couldn't find the target. The default directory was the Controls subfolder, and I was having trouble getting back to the source page.
I tried hardcoding that page in the NavigateURL property in the .ascx file but the best that did was to land me on the page, but all my styles, etc., were lost.
I then poked around at the link you sent, and got Request.Path to work. I now build and assign the NavigateURL value in the control code behind, and after a few misses got that to work perfectly. Thank you!!!
P.S., code behind below