?
Solved

Button not performing Asynch Postback

Posted on 2009-04-09
2
Medium Priority
?
395 Views
Last Modified: 2013-11-07
Full of frustration here.  I have a very simple page that works by itself.  But, when I add it to another project, it *works*, but instead of doing the asynch postback, I'm getting a full post back.  I don't even know how to troubleshoot this.  The code is good, so something about my configurartion must be wrong...but what?

I've tested a lot of different things...for instance, I've tried putting a GridView in the update panel and guess what....the Header Sort works asynchronosly.  On the same page, the Button does a full post back.  Sigh.  Where should I start digging to find the culprit?

Here is the code -


---------.net page-------
<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="test.aspx.vb" Inherits="HSE.test" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>Untitled Page</title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <asp:ScriptManager ID="ScriptManager1" runat="server">
        </asp:ScriptManager>
        <asp:UpdatePanel runat="server" UpdateMode="conditional" ID="updatePanel">
            <ContentTemplate>
                <asp:Label runat='server' ID="label1" />
                <asp:Button runat="server" ID="button1" Text="update" OnClick="button1_Click" />
            </ContentTemplate>
            <Triggers>
                <asp:AsyncPostBackTrigger ControlID="button1" />
            </Triggers>
        </asp:UpdatePanel>
    </div>
    </form>
</body>
</html>




-------code behind-----
Public Partial Class test
    Inherits System.Web.UI.Page

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

    End Sub

    Protected Sub button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
        label1.Text = Now.ToString()
    End Sub
End Class
0
Comment
Question by:Steve Krile
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
2 Comments
 
LVL 16

Author Comment

by:Steve Krile
ID: 24106670
So...I continue to dig.  I put that grid in my test code and checked what was generated when the page was created.  Here is what my button looks like:

<input type="submit" name="button1" value="update" id="button1" />


And here is what one of the heads of the gridview looks like:

<a onclick="javascript:__gvPlantOpsview.callback(&quot;0|0|/wEFB0NvdW50cnnwBCUCC72UOdxtKslQe3oHsM8F0g==|&quot;); return false;" href="javascript:__doPostBack('PlantOpsview','Sort$Country')">Country</a>



Looks like Ajax is doing the right thing with the grid headers, but not with the button....weird.
0
 
LVL 16

Accepted Solution

by:
Steve Krile earned 0 total points
ID: 24108162
Sometimes a chainsaw is the best approach.  After slicing a scalpal through my web.config and references ad nauseum, I did the sensible thing and started my project over....problem solved.
0

Featured Post

NEW Veeam Agent for Microsoft Windows

Backup and recover physical and cloud-based servers and workstations, as well as endpoint devices that belong to remote users. Avoid downtime and data loss quickly and easily for Windows-based physical or public cloud-based workloads!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
Suggested Courses

765 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question