Login

Username

Password





Register   Reset password

This is a read-only archive of the forum.

# D3grade 5/1/2007 5:17 AM
Hi Guys,

I seem to have a problem setting the NavigateUrl of a hyperlink in my module.

In the admin page, on page_load i set a hyperlinks NavigateUrl to another page in the same directory ie:
hplBack.NavigateUrl = "AdminNewsletter.aspx";

however, when it renders it seems to think it is sat in the Web/Controls directory (which i assume is becuase it murges with the admin templates)

Does anyone know how to use NavigateUrl withouth having to set it to an absolute path?

Matt
# martijnb 5/2/2007 2:58 AM
I always use the tilde trick (~/MyModule/AdminNewsletter.aspx). Not entirely relative, but at least youi don't have to specify the host and application in the urls.
It might also be possible that ResolveUrl can do something:
hplBack.NavigateUrl = Page.ResolveUrl("AdminNewsletter.aspx");
# D3grade 5/2/2007 9:43 AM
Cheers martijn

I'm currently usin the tilde one at the mo, but didn't really like referencing the full path, but i guess if it's not going to move then it shouldn't be a problem.

I'll take a look at resolve url and see how it goes.

Matt