Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8323207
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T23:39:10+00:00 2026-06-08T23:39:10+00:00

I want to run this JavaScript function on asp.net button click event.But map didn’t

  • 0

I want to run this JavaScript function on asp.net button click event.But map didn’t get loaded when i click the button.Here is my code.Please help me.

<script type="text/javascript"
    src="http://maps.google.com/maps/api/js?sensor=false">
  </script>

//This is my JavaScript function

<script type="text/javascript">
    var map;
    var layerl0;
    function initializes() 
    {
      map = new google.maps.Map(document.getElementById('map-canvas'), {
        center: new google.maps.LatLng(16.003575733881323, 81.298828125),
        zoom: 5,
        mapTypeId: google.maps.MapTypeId.HYBRID
      });
      layerl0 = new google.maps.FusionTablesLayer({
        query: {
          select: "'geometry'",
          from: '4757916',
          where: "Address='kerala'"
        },
        map: map
      });
    }
  </script>

// This is asp.net code

<body>
    <form id="form1" runat="server">
    <div>
    <div>
    <div id="map-canvas" style="height: 421px"></div>
    </div>
    <asp:Button ID="Button1" OnClientClick="initializes()" runat="server" Text="Button" />
    </div>
    </form>
</body>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T23:39:12+00:00Added an answer on June 8, 2026 at 11:39 pm

    Copied from my comment above:

    I’m assuming the button is causing a postback to occur, thus stopping the JS from running in the client’s browser. Use a standard html button or input type=button element instead of an asp:Button. That will just cause headaches if all you’re using it for is client-side interaction

    And a Fiddle: http://jsfiddle.net/qbjAD/

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

So basically I want to add a javascript function to a button's Click event
Sorry to follow this topic http://stackoverflow.com/questions/11044825/javascript-run-on-ie-7 I want to use document.GetElementByClassName ON INTERNET EXPLORE
I want to run this PHP function -- $querystring_arr='maxResults=50&startIndex=50&sort=date'; $str=preg_replace((&startIndex=)?[0-9]*(&)?,&startIndex=.$sindex.&,$querystring_arr); When I print $str
Following this problem ASP.NET: OnServerClick event handler not called if using onclick I implemented
I want to run a JavaScript function to initialize some controls. My problem is
How can I make this run at server? javascript: function confirm_delete() { if (confirm(Are
I have the javascript code below which disables an asp.net button during page postback.
So I want to run some javaScript function after my updatepanel is updated, so
Why this code don't work,when i want run this code vwd 2008 express show
I have written php program and uploaded on server. I want run this program

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.