<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="mapsettings.aspx.cs" Inherits="mapsettings" %> <asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server"> <script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?key=AIzaSyC6v5-2uaq_wusHDktM9ILcqIrlPtnZgEk&sensor=false"> </script> <script type="text/javascript"> function initialize() { var lat = document.getElementById('txtlat').value; var lon = document.getElementById('txtlon').value; var myLatlng = new google.maps.LatLng(lat, lon) // This is used to center the map to show our markers var mapOptions = { center: myLatlng, zoom: 6, mapTypeId: google.maps.MapTypeId.ROADMAP, marker: true }; var map = new google.maps.Map(document.getElementById("map_canvas"), mapOptions); var marker = new google.maps.Marker({ position: myLatlng }); marker.setMap(map); } </script> <form id="form1" runat="server"> <table> <tr> <td>Enter Latitude:</td> <td><input type="text" id="txtlat" value="13.053147716796578" /> </td> </tr> <tr> <td>Enter Longitude:</td> <td><input type="text" id="txtlon" value="80.2501953125" /> </td> </tr> <tr> <td></td> <td><input type="button" value="Submit" önclick="javascript: initialize()" /> </td> </tr> </table> <div id="map_canvas" style="width: 500px; height: 400px"></div> </form>
Quote:it's indeed only allowed to have one, visible, server form on one page (even in combination with a master page). So simply remove <form id="form1" runat="server"> and the closing </form> tag and you should be good to go.
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)