Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

AsyncPostBackTrigger doesn't work in production

Status
Not open for further replies.

JScannell

Programmer
Jan 9, 2001
306
US
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
 
This looks like ASP.NET rather than AJAX - try forum855 ( AJAX in the context of this forum is Asynchronous Javascript And XML)

If you want the best response to a question, please check out FAQ222-2244 first.
'If we're supposed to work in Hex, why have we only got A fingers?'
Drive a Steam Roller
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top