1
Vote

When NavigationMode is set to Link, broken links are generated [imported from GotDotNet]

description

=== Opened by spacenjason @ 2/13/2007 8:30:05 AM ===
When navigationmode is set to "Link", broken links are generated for all albums and images. This is caused by the use of AppRelativeVirtualPath. It generates a relative URL with the tilda (~) symbol that browsers are unable to interpret.

comments

n_lamprecht wrote Jun 27, 2007 at 7:46 PM

I have the same problem and I fixed inside the "public string Permalink":if (_owner.NavigationMode == NavigationMode.Link) { return HttpContext.Current.Request.ApplicationPath +_permalink.Remove(0, 2); } else return _permalink;

n_lamprecht wrote Jul 5, 2007 at 4:58 PM

Or if the handler is in a virtual directory, this works even better:/// /// A permanent link to this image's preview page. /// public string PermaLink { get { if (_permalink == null) { _permalink = ((_owner.Page != null) ? _owner.ResolveClientUrl(_owner.Page.AppRelativeVirtualPath) : String.Empty) + "?albummode=" + AlbumMode + "&albumpath=" + HttpUtility.UrlEncode(_path); } if (_owner.NavigationMode == NavigationMode.Link) { return _permalink.Replace("~/", _owner.Page.TemplateSourceDirectory + "/"); } else return _permalink; }