First thing. The UpdatePanel works flawlessly within the VS 2010 IDE, so trying to fix the problem on the actual website is really tough. I have added a table update within the button click event. I get two events in the IDE but only one in production. What's supposed to happen is a from and to address range is sent to a <directions> and the resulting route is supposed to display on the screen.
We are moving our website from server-a to server-b so getting this to work is extremely important.
Here's some details:
First the markup
<asp:UpdatePanel ID="UpdatePanel1" runat="server" updatemode="Always">
<Triggers>
<asp:AsyncPostBackTrigger controlid="UpdateButton1"/>
</Triggers>
<ContentTemplate>
<artem:GoogleMap ID = "GoogleMap2"
runat = "server"
Width = "300px"
Height = "300px"
Latitude = "39.952335"
Longitude = "-75.163789"
Zoom = "4"
BorderStyle = "Solid"
BorderColor = "#999999"
BorderWidth = "1">
<Directions>
<artem:GoogleDirection RoutePanelId="route" Query="" />
</Directions>
</artem:GoogleMap>
<div id="route">
<br />
<asp:Button id = "UpdateButton1"
runat = "server"
causesvalidation = "false"
onclick = "UpdateButton_Click"
text = "Get Directions" />
</ContentTemplate>
</asp:UpdatePanel>
Here's the code behind for the button click:
Protected Sub UpdateButton_Click(ByVal sender As Object, _
ByVal e As System.EventArgs) _
Handles UpdateButton1.Click
Dim StartAdd As TextBox = FindControlRecursive(DetailsView1, "TextBox2")
Dim EndAdd As TextBox = FindControlRecursive(DetailsView1, "TextBox3")
Dim query As String = "from: " & StartAdd.Text & " to: " & EndAdd.Text
'
' for debug...
'
Dim oLogError As New LogError(Server.GetLastError, Request)
oLogError.LogToDatabase ( "Getting Directions", query )
Me.GoogleMap2.Directions.Item(0).Query = query
End Sub
I've tried several things but nothing changes. Originally the updatemode was Conditional, but I found a suggestion on another forum to change it to Always. Another forum suggested adding 'Async="true"' at the top of the .aspx file. It always works in the IDE and never on the website. I should add that there is a copy of the website on another server that is using old code that I didn't create and it works fine. I originally copyied that entire website over to the new server but had a problem with Googlemap Api Key. I resolved that by deleting and re-adding the UpdatePanel (don't know why that worked).
Thanks in advance,
Jerry Scannell
We are moving our website from server-a to server-b so getting this to work is extremely important.
Here's some details:
First the markup
<asp:UpdatePanel ID="UpdatePanel1" runat="server" updatemode="Always">
<Triggers>
<asp:AsyncPostBackTrigger controlid="UpdateButton1"/>
</Triggers>
<ContentTemplate>
<artem:GoogleMap ID = "GoogleMap2"
runat = "server"
Width = "300px"
Height = "300px"
Latitude = "39.952335"
Longitude = "-75.163789"
Zoom = "4"
BorderStyle = "Solid"
BorderColor = "#999999"
BorderWidth = "1">
<Directions>
<artem:GoogleDirection RoutePanelId="route" Query="" />
</Directions>
</artem:GoogleMap>
<div id="route">
<br />
<asp:Button id = "UpdateButton1"
runat = "server"
causesvalidation = "false"
onclick = "UpdateButton_Click"
text = "Get Directions" />
</ContentTemplate>
</asp:UpdatePanel>
Here's the code behind for the button click:
Protected Sub UpdateButton_Click(ByVal sender As Object, _
ByVal e As System.EventArgs) _
Handles UpdateButton1.Click
Dim StartAdd As TextBox = FindControlRecursive(DetailsView1, "TextBox2")
Dim EndAdd As TextBox = FindControlRecursive(DetailsView1, "TextBox3")
Dim query As String = "from: " & StartAdd.Text & " to: " & EndAdd.Text
'
' for debug...
'
Dim oLogError As New LogError(Server.GetLastError, Request)
oLogError.LogToDatabase ( "Getting Directions", query )
Me.GoogleMap2.Directions.Item(0).Query = query
End Sub
I've tried several things but nothing changes. Originally the updatemode was Conditional, but I found a suggestion on another forum to change it to Always. Another forum suggested adding 'Async="true"' at the top of the .aspx file. It always works in the IDE and never on the website. I should add that there is a copy of the website on another server that is using old code that I didn't create and it works fine. I originally copyied that entire website over to the new server but had a problem with Googlemap Api Key. I resolved that by deleting and re-adding the UpdatePanel (don't know why that worked).
Thanks in advance,
Jerry Scannell