Click here to Skip to main content
15,910,083 members
Home / Discussions / ASP.NET
   

ASP.NET

 
GeneralCalling ClientSide Script 'after' handling server side [modified] Pin
Malcolm Smart19-Aug-07 11:58
Malcolm Smart19-Aug-07 11:58 
GeneralRe: Calling ClientSide Script 'after' handling server side Pin
Fred_Smith19-Aug-07 12:45
Fred_Smith19-Aug-07 12:45 
GeneralRe: Calling ClientSide Script 'after' handling server side Pin
Malcolm Smart19-Aug-07 13:31
Malcolm Smart19-Aug-07 13:31 
QuestionHow to call javascript function from aspx page Pin
beish119-Aug-07 7:36
beish119-Aug-07 7:36 
AnswerRe: How to call javascript function from aspx page Pin
Bassam Saoud19-Aug-07 7:52
Bassam Saoud19-Aug-07 7:52 
GeneralRe: How to call javascript function from aspx page Pin
beish119-Aug-07 13:02
beish119-Aug-07 13:02 
GeneralRe: How to call javascript function from aspx page Pin
Christian Graus19-Aug-07 13:17
protectorChristian Graus19-Aug-07 13:17 
GeneralRe: How to call javascript function from aspx page Pin
beish119-Aug-07 13:50
beish119-Aug-07 13:50 
My complete code is below - I think the processes are in the correct order as the Response.Write(Lat) produces the latitude values from the database after the opening Google Map is displayed. If I move the map.addControl lines to the sb.append stringbuilder, they don't display - which would seem to indicate that the ClientScript.RegisterClientScriptBlock is incorrectly formatted, or the Stringbuilder. Not sure of what the "Type" is supposed to be or if the random name "sbf" I've given it should be something more specific.

<%@Import Namespace="System.Data" %>
<%@Import Namespace="System.Data.SqlClient" %>
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="mapmysql.aspx.vb" Inherits="mapmysql" %>





<title>Untitled Page






//<![CDATA[

var map = new GMap2(document.getElementById("map"));
map.addControl(new GLargeMapControl());
map.addControl(new GMapTypeControl());
map.addControl(new GScaleControl());
map.setCenter(new GLatLng(51.512161, -0.14110), 11);

// Creates a marker whose info window displays the given number
function createMarker(point, number)
{
var marker = new GMarker(point);
// Show this markers index in the info window when it is clicked
var html = number;
GEvent.addListener(marker, "click", function() {marker.openInfoWindowHtml(html);});
return marker;
};
//]]>

<% Dim conn As SqlConnection
conn = New SqlConnection("Data Source=beish2;Initial Catalog=HA4;Integrated Security=True")
conn.Open()
Dim sqlComm As New SqlCommand("SELECT PlaceID,PlaceName, PlaceLat, PlaceLng FROM Places ORDER BY PlaceName", conn)
Dim r As SqlDataReader = sqlComm.ExecuteReader()
While r.Read()
Dim username As String = CStr(r("PlaceName"))
Dim userID As Integer = CInt(r("PlaceID"))
Dim Lat As Double = CDbl(r("PlaceLat"))
Dim Lng As Double = CDbl(r("PlaceLng"))

Dim sb As StringBuilder = New StringBuilder
sb.Append("")
sb.Append("//<![CDATA[" & vbCrLf)
sb.Append("map.setCenter(new GLatLng(50.952803, -4.139785 ),9);")


sb.Append("//]]>")
sb.Append("")

ClientScript.RegisterClientScriptBlock(Me.GetType(), "sbf", sb.ToString())

Response.Write(Lat)

End While
r.Close()%>




GeneralRe: How to call javascript function from aspx page Pin
beish119-Aug-07 14:01
beish119-Aug-07 14:01 
QuestionNeed Suggestions before starting... Pin
just3ala219-Aug-07 4:11
just3ala219-Aug-07 4:11 
AnswerRe: Need Suggestions before starting... Pin
Not Active19-Aug-07 5:09
mentorNot Active19-Aug-07 5:09 
Questiondrag and drop element with javascript !!!!!!!!!!!! Pin
mr.mohsen19-Aug-07 3:37
mr.mohsen19-Aug-07 3:37 
AnswerRe: drag and drop element with javascript !!!!!!!!!!!! Pin
Michael Sync19-Aug-07 4:59
Michael Sync19-Aug-07 4:59 
AnswerRe: drag and drop element with javascript !!!!!!!!!!!! Pin
Not Active19-Aug-07 5:00
mentorNot Active19-Aug-07 5:00 
QuestionDataList Edit and Update please help very urgent.. Pin
bijeshputhalath19-Aug-07 1:32
bijeshputhalath19-Aug-07 1:32 
AnswerRe: DataList Edit and Update please help very urgent.. [modified] Pin
John-ph19-Aug-07 4:51
John-ph19-Aug-07 4:51 
AnswerRe: DataList Edit and Update please help very urgent.. Pin
Michael Sync19-Aug-07 4:53
Michael Sync19-Aug-07 4:53 
QuestionHttpWebRequest in medium trust Pin
daniel__c18-Aug-07 21:40
daniel__c18-Aug-07 21:40 
QuestionUpdate in GridView Pin
ksaw12318-Aug-07 20:54
ksaw12318-Aug-07 20:54 
AnswerRe: Update in GridView Pin
Milind Panchal18-Aug-07 21:31
Milind Panchal18-Aug-07 21:31 
GeneralRe: Update in GridView Pin
ksaw12319-Aug-07 22:17
ksaw12319-Aug-07 22:17 
QuestionGridview Pin
Milind Panchal18-Aug-07 19:38
Milind Panchal18-Aug-07 19:38 
AnswerRe: Gridview Pin
#realJSOP19-Aug-07 1:57
professional#realJSOP19-Aug-07 1:57 
QuestionError Handling issue Pin
chris_wanaka18-Aug-07 17:45
chris_wanaka18-Aug-07 17:45 
QuestionASPX pages don't work after deployment Pin
ASPnoob18-Aug-07 12:36
ASPnoob18-Aug-07 12:36 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.