ASP.NET Page /Admin/Test.aspx (C#)
Uses Code Behind Page Page /Admin/Test.aspx.cs (C#)
1: <%@ Page Language="C#" AutoEventWireup="True" Inherits="_Test" Codebehind="Test.aspx.cs" %>  
2: <%@ Register Src="~/Controls/GoogleMapForASPNet.ascx" TagName="GoogleMapForASPNet" TagPrefix="uc1"%>  
3: <%@ Register Assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"  
4:     Namespace="System.Web.UI" TagPrefix="asp" %>  
5:   
6: <style type="text/css">  
7:       html, body, #map_canvas {  
8:         margin: 0;  
9:         padding: 0;  
10:         height: 100%;  
11:       }  
12:     </style>  
13:   
14: <script type="text/javascript" src="../Include/jquery.js"></script>  
15: <script type="text/javascript" src="../Include/jquery-1.7.2.min.js"></script>  
16:   
17: <script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?sensor=false"></script>  
18:   
19: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">  
20:   
21: <html xmlns="http://www.w3.org/1999/xhtml" >  
22: <head id="Head1" runat="server">  
23:     <title>Untitled Page</title>  
24: </head>  
25: <body onload="initialize()">  
26:       
27:     <form id="form1" runat="server">  
28:     <asp:ScriptManager ID="ScriptManager1" runat="server"/>  
29:   
30: <script type="text/javascript">  
31:     var map;  
32:     var infowindowLevel = 0;  
33:     var prm = Sys.WebForms.PageRequestManager.getInstance();  
34:     prm.add_initializeRequest(InitializeRequest);  
35:     prm.add_endRequest(EndRequest);  
36:   
37:     function InitializeRequest(sender, args) {  
38:     }  
39:   
40:     // fires after the partial update of UpdatePanel  
41:     function EndRequest(sender, args) {  
42:         initialize()  
43:     }  
44:   
45:     function initialize() {  
46:         //Center of the earth  
47:         var latlng = new google.maps.LatLng(24.324408, 12.216797);  
48:         var mapOptions = {  
49:             zoom: 2,  
50:             center: latlng,  
51:             mapTypeId: google.maps.MapTypeId.ROADMAP  
52:         };  
53:   
54:         map = new google.maps.Map(document.getElementById("map_canvas"),mapOptions);  
55:   
56:         setMarkers(map);  
57:   
58:     }  
59:   
60:   
61:     function setMarkers(map) {  
62:         var logs;  
63:   
64:         var OnlyRegisteredUsers = "0"  
65:         if (OnlyRegisteredUsers == "1")  
66:             OnlyRegisteredUsers = true;  
67:         else  
68:             OnlyRegisteredUsers = false;  
69:   
70:         var LogArea = "";  
71:   
72:         var lstCountries = "";  
73:   
74:         var myLatLng = new google.maps.LatLng(5, 5);  
75:         var marker = new google.maps.Marker({  
76:             position: myLatLng,  
77:             map: map  
78:         });  
79:         marker.setTitle("Hello World");  
80:         attachInfowindow(marker, 5);  
81:     }  
82:   
83:   
84:     function attachInfowindow(marker, number) {  
85:         var infowindow = new google.maps.InfoWindow(  
86:       { content: "I like to be on top!"  
87:       });  
88:         google.maps.event.addListener(marker, 'click', function () {  
89:             infowindow.setZIndex(++infowindowLevel);  
90:             infowindow.open(map, marker);  
91:         });  
92:     }  
93:     function cmdClearLog_Click() {  
94:   
95:         $(document).ready(function () {  
96:             $.ajax  
97:             ({  
98:                 type: "POST",  
99:                 contentType: "application/json; charset=utf-8",  
100:                 url: "/WebServices/LogService.asmx/ClearLog",  
101:                 data: "{}",  
102:                 dataType: "json",  
103:                 success: function (response) {  
104:                     form1.submit();  
105:                 },  
106:                 failure: function (msg) {  
107:                     alert(msg);  
108:                 }  
109:             });  
110:         });  
111:   
112:   
113:     }  
114:     </script>  
115:   
116:     <div>  
117:   
118:         <div id="map_canvas" style="width:1000px; height:600px"></div>  
119:   
120:     </div>  
121:     </form>  
122: </body>  
123: </html>  

.NET Documentation Tool is © 2002 - 2009 Winnersh Triangle Web Solutions Limited.