Solved

Button not performing Asynch Postback

Posted on 2009-04-09
2
343 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
  • 2
2 Comments
 
LVL 16

Author Comment

by:Steve Krile
Comment Utility
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
Comment Utility
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

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

In my previous article (http://www.experts-exchange.com/Programming/Languages/.NET/.NET_Framework_3.x/A_4362-Serialization-in-NET-1.html) we saw the basics of serialization and how types/objects can be serialized to Binary format. In this blog we wi…
I found this questions asking how to do this in many different forums, so I will describe here how to implement a solution using PHP and AJAX. The logical flow for the problem should be: Write an event handler for the first drop down box to get …
This video discusses moving either the default database or any database to a new volume.
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

743 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now