S
sviau
im getting a string and urlencoding it (in the SanitizeForQueryString
function) is this the correct approach? should i be encoding each parameter
seperately or the entire string?
Dim AreaID As String = Request.Form(hAreaID.UniqueID)
Dim SalePrice As String =
SanitizeForQueryString(Request.Form(elMinPrice.ControlID)) & "-" &
SanitizeForQueryString(Request.Form(elMaxPrice.ControlID)) & "-0"
Dim RentPrice As String =
SanitizeForQueryString(Request.Form(elMinRent.ControlID)) & "-" &
SanitizeForQueryString(Request.Form(elMaxRent.ControlID)) & "-0"
Dim QString As New System.Text.StringBuilder
With QString
..Append("?Mode=0")
..Append("&Page=1")
..Append("&vs=1")
..Append("&rlt=")
..Append(SanitizeForQueryString(Request.Form(txtRealtorName.UniqueID)))
..Append("&cp=")
..Append(SanitizeForQueryString(Request.Form(txtBrokerCompany.UniqueID)))
..Append("&pt=")
..Append(SanitizeForQueryString(elPropertyTypes.GetSelectedValues))
..Append("&mp=")
..Append(SalePrice)
..Append("&mrt=")
..Append(RentPrice)
..Append("&Beds=")
..Append(SanitizeForQueryString(Request.Form(elBeds.ControlID)))
..Append("&Baths=")
..Append(SanitizeForQueryString(Request.Form(elBaths.ControlID)))
..Append("&f=")
..Append(SanitizeForQueryString(Request.Form(elFeatures.ControlID)))
..Append("&ft=")
..Append(SanitizeForQueryString(Request.Form(ddlFeatureType.UniqueID)))
..Append("&o=")
..Append(SanitizeForQueryString(Request.Form(ddlOrder.UniqueID)))
..Append("&of=")
..Append(SanitizeForQueryString(Request.Form(ddlOrderField.UniqueID)))
..Append("&ps=")
..Append(SanitizeForQueryString(Request.Form(ddlPageSize.UniqueID)))
If Not AreaID Is Nothing AndAlso AreaID <> String.Empty Then
..Append("&aid=")
..Append(SanitizeForQueryString(AreaID))
..Append("&MapURL=")
..Append(SanitizeForQueryString(Request.QueryString("MapURL")))
Else
..Append("&pro=")
..Append(SanitizeForQueryString(Request.Form(elProvinces.ControlID)))
..Append("&ci=")
..Append(SanitizeForQueryString(Request.Form(txtCity.UniqueID)))
..Append("&st=")
..Append(SanitizeForQueryString(Request.Form(txtStreet.UniqueID)))
..Append("&zip=")
..Append(SanitizeForQueryString(Request.Form(txtPostalCode.UniqueID)))
End If
End With
function) is this the correct approach? should i be encoding each parameter
seperately or the entire string?
Dim AreaID As String = Request.Form(hAreaID.UniqueID)
Dim SalePrice As String =
SanitizeForQueryString(Request.Form(elMinPrice.ControlID)) & "-" &
SanitizeForQueryString(Request.Form(elMaxPrice.ControlID)) & "-0"
Dim RentPrice As String =
SanitizeForQueryString(Request.Form(elMinRent.ControlID)) & "-" &
SanitizeForQueryString(Request.Form(elMaxRent.ControlID)) & "-0"
Dim QString As New System.Text.StringBuilder
With QString
..Append("?Mode=0")
..Append("&Page=1")
..Append("&vs=1")
..Append("&rlt=")
..Append(SanitizeForQueryString(Request.Form(txtRealtorName.UniqueID)))
..Append("&cp=")
..Append(SanitizeForQueryString(Request.Form(txtBrokerCompany.UniqueID)))
..Append("&pt=")
..Append(SanitizeForQueryString(elPropertyTypes.GetSelectedValues))
..Append("&mp=")
..Append(SalePrice)
..Append("&mrt=")
..Append(RentPrice)
..Append("&Beds=")
..Append(SanitizeForQueryString(Request.Form(elBeds.ControlID)))
..Append("&Baths=")
..Append(SanitizeForQueryString(Request.Form(elBaths.ControlID)))
..Append("&f=")
..Append(SanitizeForQueryString(Request.Form(elFeatures.ControlID)))
..Append("&ft=")
..Append(SanitizeForQueryString(Request.Form(ddlFeatureType.UniqueID)))
..Append("&o=")
..Append(SanitizeForQueryString(Request.Form(ddlOrder.UniqueID)))
..Append("&of=")
..Append(SanitizeForQueryString(Request.Form(ddlOrderField.UniqueID)))
..Append("&ps=")
..Append(SanitizeForQueryString(Request.Form(ddlPageSize.UniqueID)))
If Not AreaID Is Nothing AndAlso AreaID <> String.Empty Then
..Append("&aid=")
..Append(SanitizeForQueryString(AreaID))
..Append("&MapURL=")
..Append(SanitizeForQueryString(Request.QueryString("MapURL")))
Else
..Append("&pro=")
..Append(SanitizeForQueryString(Request.Form(elProvinces.ControlID)))
..Append("&ci=")
..Append(SanitizeForQueryString(Request.Form(txtCity.UniqueID)))
..Append("&st=")
..Append(SanitizeForQueryString(Request.Form(txtStreet.UniqueID)))
..Append("&zip=")
..Append(SanitizeForQueryString(Request.Form(txtPostalCode.UniqueID)))
End If
End With