I was having interesting issues trying to get a query string to work. I was using the method Return DotNetNuke.Common.NavigateURL(Me.TabId, arrayOfStrings)
The link returned inserted "ctl/(control_id/" into the string. With this string, the page requested will not execute page load. I can insert a break point, and it will not hit. If I remove ctl/58 (whatever the control id is), then the query string works. I have a regex expression to remove the ctl/id from the string. But I am thinking there must be some overload that does this automatically.
I am using the following code inorder to get a QueryString to work (I had to HACK):
''' <summary>
'''
''' </summary>
''' <param name="countryAbbreviation">The value for the country query parameter</param>
''' <param name="regionAbbreviation">The value for the region query parameter</param>
''' <param name="cityName">The value for the city query parameter</param>
''' <returns>DNN NavigateUrl QueryString</returns>
''' <remarks>jfs 08-31-07</remarks>
Private Function BuildNavigateUrl(ByVal countryAbbreviation As String, _
ByVal regionAbbreviation As String, ByVal cityName As String) As String
Dim navUrl As String = DotNetNuke.Common.NavigateURL()
Dim params As New Generic.List(Of String)()
If Not countryAbbreviation Is Nothing Then
If Not String.IsNullOrEmpty(countryAbbreviation) Then
params.Add(String.Concat(CountryKeyName, "=", countryAbbreviation))
If Not regionAbbreviation Is Nothing Then
If Not String.IsNullOrEmpty(regionAbbreviation) Then
params.Add(String.Concat(RegionKeyName, "=", regionAbbreviation))
If Not cityName Is Nothing Then
If Not String.IsNullOrEmpty(cityName) Then params.Add(String.Concat(CityKeyName, "=", cityName))
End If
End If
End If
End If
End If
Dim arrayOfStrings(params.Count) As String
Dim i As Integer = 0
For Each param As String In params
arrayOfStrings(i) = param
i += 1
Next
'Return DotNetNuke.Common.NavigateURL(Me.TabId, arrayOfStrings)
Return Regex.Replace(DotNetNuke.Common.NavigateURL(Me.TabId, arrayOfStrings), "ctl/\w\d*/", "")
End Function
Has anyone had issues with a FriendlyUrl QueryString? With this RegularExpress, all my query strings are now working in FriendlyURL format.
The question is WHY is the ctl=value parameter being inserted for me? It mirrors the tab id in my case, and one reason this have misfired is likely the value of ctl may not be valid. I did not look into the DB to find out. Any thoughts on this would be appreciated. Thank you.