Click here to Skip to main content
15,891,657 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I code made this code in Delphi
Delphi
procedure TForm10.Button1Click(Sender: TObject);
  var
  Response: TStringStream;
  Params: TStringList;
begin
Params := TStringList.Create;
try
  Params.Add('long=' + edit1.Text);
  Params.Add('lat=' + edit2.Text);
  Response := TStringStream.Create('');
  try
     IdHTTP1.Post('http://localhost:1645/default', Params, Response);
     memo1.Text := Response.DataString;
  except
   on E: Exception do
   begin
    showmessage('Error: ' + E.Message);
   end;
  end;

finally
  Params.Free;
  Response.Free;
end;

end;


to send parameters to a website in asp.net (googlemaps which takes long and lat as parameters )

here is the asp code
c#
C#
public partial class YourFirstGoogleMap : System.Web.UI.Page
{
    public string v;
    public string c;
    protected void Page_Load(object sender, EventArgs e)
    {

      v = Request.QueryString["long"];
        if (v != null)
        {
            Response.Write("param is ");
            Response.Write(v);
        }

        c = Request.QueryString["lat"];
        if (c != null)
        {
            Response.Write("param is ");
            Response.Write(c);
        }


    }
}


and javascript
JavaScript
<script type ="text/javascript">
    function InitializeMap() 
    {
        var latlng = new google.maps.LatLng(<%=v%>, <%=c%>);
        var myOptions = {
            zoom: 3,
            center: latlng,
            mapTypeId: google.maps.MapTypeId.ROADMAP
        };
        var map = new google.maps.Map(document.getElementById("map"), myOptions);
    }
    window.onload = InitializeMap;

</script>



Any help?

What I have tried:

I run it in IIS localhost, when I manually type long and lat asp google maps Works, but when I post from delphi application doesn't happend anything.
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900