Reputation: 5377
MY PHP Code is
$geourl = 'http://maps.google.com/maps/geo?key=' . $google_apikey .
'&output=json'. '&q=' . urlencode($_GET['url'] . ', USA').'&gl=us';
My ASPX code looks like this
Dim google_apikey As String="sdasdasd"
Dim geourl As String= "http://maps.google.com/maps/geo?key=" & google_apikey & _
"&output=json" & "&q=" & urlencode(request.QueryString("pc")& ", USA")"&gl=us"
The Error i get is Compiler Error Message: BC30205: End of statement expected.
Instead of Period (.) i have used & is it valid in vb.net, what is the problem with the above string, urlencode ?
Upvotes: 0
Views: 1007
Reputation: 2833
Think you missed a concatenator right at the end. Should it be:
Dim geourl As String= "http://maps.google.com/maps/geo?key=" & google_apikey & _
"&output=json" & "&q=" & UrlEncode(request.QueryString("pc")& ", USA") & _
"&gl=us"
Upvotes: 1
Reputation: 1038810
I would recommend you using the String.Format
method to make your code more readable:
Dim google_apikey As String="sdasdasd"
Dim geourl As String = String.Format("http://maps.google.com/maps/geo?key={0}&output=json&q={1},USA&gl=us", UrlEncode(google_apikey), UrlEncode(Request.QueryString("pc")))
Upvotes: 0