Click here to Skip to main content
15,850,685 members
Please Sign up or sign in to vote.
3.86/5 (3 votes)
See more:
<%@ 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"
<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
     <form id="form1"  runat="server">
<td>Enter Latitude:</td>
<td><input type="text" id="txtlat" value="13.053147716796578" /> </td>
<td>Enter Longitude:</td>
<td><input type="text" id="txtlon" value="80.2501953125" /> </td>
<td><input type="button" value="Submit"  önclick="javascript: initialize()" /> </td>
<div id="map_canvas" style="width: 500px; height: 400px"></div>

when i run this code i get an error help me to fix it.
A page can have only one server-side Form tag.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Web.HttpException: A page can have only one server-side Form tag.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Updated 15-Apr-14 3:05am

1 solution

Here is the solution for your problem.Please try it. :)

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.

Another link :

A page can have only one server-side Form tag.[^]
Share this answer
Sunasara Imdadhusen 15-Apr-14 6:10am    
I think this solution will help you!
Sampath Lokuge 15-Apr-14 7:29am    
Thanks Sunasara. :)
Bajpangosh 15-Apr-14 9:44am    
thnaks it's works. bro can u help a pointer can + set the value to box and save to database any ideas..?
Sampath Lokuge 15-Apr-14 9:50am    
You're warmly welcome.If you feel this is the Answer,Plz Accept it.It'll help for the user who will have the same issue in the future.Plz put your next question on new thread and let me know.I'll try then. :)
Bajpangosh 15-Apr-14 11:25am    
here mine question :)

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