I
ibiza
Hi all,
I have a problem which I don't understand with the "~" mark in a
NavigateUrl property of an asp:HyperLink. I have this in a master page,
to build the standard menu (rMenuItems is a Repeater):
Protected Sub rMenuItems_ItemDataBound(ByVal sender As Object, ByVal e
As System.Web.UI.WebControls.RepeaterItemEventArgs)
If e.Item.ItemType = ListItemType.Item Or e.Item.ItemType =
ListItemType.AlternatingItem Then
CType(e.Item.FindControl("lnk"), HyperLink).NavigateUrl =
DataBinder.Eval(e.Item.DataItem, "Url")
End If
End Sub
It works well, if the url in the browser is at root. Example, if I am
at : http://localhost/faq.aspx, it works.
As soon as I am not in the root directory, e.g.:
http://localhost/test/test.aspx, the links now all point to a location
in the subfolder. e.g.: the link who was mapped with "~/default.aspx"
points at http://localhost/test/default.aspx in the browser.
Anyone knows the correction for this one?...
thanks!
ibiza
I have a problem which I don't understand with the "~" mark in a
NavigateUrl property of an asp:HyperLink. I have this in a master page,
to build the standard menu (rMenuItems is a Repeater):
Protected Sub rMenuItems_ItemDataBound(ByVal sender As Object, ByVal e
As System.Web.UI.WebControls.RepeaterItemEventArgs)
If e.Item.ItemType = ListItemType.Item Or e.Item.ItemType =
ListItemType.AlternatingItem Then
CType(e.Item.FindControl("lnk"), HyperLink).NavigateUrl =
DataBinder.Eval(e.Item.DataItem, "Url")
End If
End Sub
It works well, if the url in the browser is at root. Example, if I am
at : http://localhost/faq.aspx, it works.
As soon as I am not in the root directory, e.g.:
http://localhost/test/test.aspx, the links now all point to a location
in the subfolder. e.g.: the link who was mapped with "~/default.aspx"
points at http://localhost/test/default.aspx in the browser.
Anyone knows the correction for this one?...
thanks!
ibiza