I recently ran into an issue setting relative URLs in a UserControl that is used in several locations. I could think of several ways that could resolve the issue through explicit coding but was keen to find a solution that didn't require the user control to know about the page it was used on.
Naturally I did some Googling to see if someone had already found a solution. There was an almost identical post on the ASP.NET forums about the issue but no one had found an acceptable solution. I did some more searching and came across a possible solution which I posted back to the ASP.NET forums for the next person to find.
A couple of days later I was surprised to get a message back from the forums that my post had been deleted as it was an old thread (June 2008) and "there is no value in reviving it".
Fair enough, it's their forum and they can set whatever rules they want. The user who deleted it was much more active on the forum than I am so I'll defer to their judgement.
Still, it's unfortunate that the next person to come across the thread won't have direct access to the possible solution that I found. As a forum they don't really focus on answering questions, but rather having discussions they will ultimately be closed off after a certain period of time.
Taking that into account I posted the same question to a more appropriate site.
---------- Forwarded message ----------
From: ASP.NET Forums - Automated Email
Date: Mon, Apr 12, 2010 at 9:05 AM
Subject: (ASP.NET Forums) Post Deleted: Re: relative url in hyperlinkfield
To: [myemailaddress]
Your post was deleted by [A forum user with a high level of Recognition].
Subject: Re: relative url in hyperlinkfield
Reason: Hello,
You attempted to submit the following post to the ASP.NET Forums:
________________________________________________________
Using Control.AppRelativeTemplateSourceDirectory you can change the URL that is used
to resolve a relative URL. You can use this to change how Case 2 resolves to a URL.
E.g. AppRelativeTemplateSourceDirectory = AppRelativeTemplateSourceDirectory.Replace("~/Controls/", "~/folder1/");
________________________________________________________
Your post was submitted as a reply to the following thread: http://forums.asp.net/thread/2449283.aspx
The thread to which you have attempted to reply is a very old thread, and there is
no value in reviving it. As a consequence, the above post has not been approved.
Replying to very old threads (aka Necro-Posting) is discouraged on the forums as it
moves those old threads ahead of the sites more recent threads. We ask all members
who are offerring answers to please stick to the site's more recent threads.
Thanks,
ASP.NET Forums team