I wasn't able to duplicate the problem using response.redirect(urlstring):
Dim gotourl As Uri = New Uri("http://www.red.com#hashthatstays")
Response.Redirect(gotourl.ToString)
...arrives at the page http://www.red.com#hashthatstays
However, if the file you're linking to has a hash in the filename:
http://www.google.com/bob#ofcars.htm, then you'll need to convert the hash character into the URL entity %23. This is because the server will be searching for the file or folder "bob", and the browser will attempt to go to the bookmark "ofcars.htm" once "bob" is opened.
http://www.google.com/bob%23ofcars.htm would open the correct file in this example (if google had a file named bob#ofcars.htm in the root folder. It doesn't, I checked ;o)
There's a full list of URL entities here:
http://www.w3schools.com/tags/ref_urlencode.asp[
^]
This gets tricky when you have a filename that contains a hash and a url with a bookmark:
The URL http://www.google.com/bob#ofcars.htm#fords needs to be transformed into
http://www.google.com/bob%23ofcars.htm#fords
to load properly in the browser - e.g. open the document and scroll to the bookmark "fords". Escaping the second hash causes it to become part of the filename the server attempts to find, and that'll result in a broken link.
Regular expressions and replacements can help parse a filename with hashes while preserving URL bookmarks.