Board index » Web Programming » Hyperlink control in user control
|
jesoldano
|
Hyperlink control in user control
Web Programming291
Hello, I am having what I think is a problem with hyperlinks in user controls. My usercontrol is in my Controls/NavControls directory. The page that I have consuming the control is in my Pages/PageInfo/ directory. My control, PageNav.ascx has an asp:hyperlink control on it that sets the NavigateUrl property dynamically. I want to set it to a local reference, something like: <a href="page2.aspx">Page2</a>or having it generate to: http://mysite/Pages/PageInfo/page2.aspx would work as well. However, it seems that the hyperlink is generating is to the Control's directory, instead of the consuming page directory.. ie it is rendering to <a href="http://mysite/Controls/NavControls/page2.aspx">Page2</a>... which is not a valid page. Does anyone know if there are any properties I can set to make this work like I want? Or is there some code involved that I'd have to put in. Thanks - |
