Ok all I want to do is take the url for the browser and do a search string on it...simple enough right!? ... HA! ... No I’m not that lucky lol ...seams when I try to use "¬" or any symbol in my url string asp.net can't find it. You see I’m calling my asp page url and adding some parameters to the url which the page takes, dose some working out with and passes back a result, but because I’m passing more then 1 parameter to the url I need to separate the parameters out with a symbol like ¬ which is not commonly used as the parameters I’m passing may contain all other symbols like ? and etc…
When I do :
Im not getting the symbols back !?Code:Dim myURL As String = Request.Url.ToString() MsgBox(myURL)
my code:
Any help welcomeCode:Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs) ' check page isn't been post back from form event procedures Try 'Get the URL 'the url would look something like : ' http://localhost:3973/Projects/RegularExpressionValidator.aspx?Value1¬Value2¬ Dim myURL As String = New String(Request.Url.ToString()) 'Does the URL contain parameters? Dim FirstParameterStart As Integer = myURL.IndexOf("?") Dim FirstParameterEnd As Integer = myURL.IndexOf("¬") Dim FirstParameter As String = "" Dim SecondParameter As String = "" FirstParameterStart = FirstParameterStart + 1 'If the URL has parameters, then get them. If not, return a blank string If FirstParameterStart > 0 and Then ' Get the first Parameter FirstParameter = myURL.Substring(FirstParameterStart, FirstParameterEnd - 1) ' Get the second Parameter SecondParameter = myURL.Substring(FirstParameterEnd + 1, myURL.LastIndexOf("¬") - 1) End If ' When tracing the ulr i get back : ' http://localhost:3973/Projects/RegularExpressionValidator.aspx?Value1Value2 ' and NOT : ' http://localhost:3973/Projects/RegularExpressionValidator.aspx?Value1¬Value2¬ MsgBox(myURL.ToString()) Catch ex As Exception MsgBox(ex.Message.ToString()) End Try End Sub![]()





Reply With Quote