I'm having a weird problem and need some assistance in troublshooting. I have a very simple page.
1 <%@ Page Language="vb" AutoEventWireup="false" CodeBehind="test.aspx.vb" Inherits="HSE.test" %>
2 <%@ Register
3 Assembly="AjaxControlToolkit"
4 Namespace="AjaxControlToolkit"
5 TagPrefix="cc1" %>
6 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
7
8 <html xmlns="http://www.w3.org/1999/xhtml" >
9 <head runat="server">
10 <title>Untitled Page</title>
11 </head>
12 <body>
13 <form id="form1" runat="server">
14 <asp:ScriptManager ID="ScriptManager1" runat="server" ScriptMode="Release" />
15
16 <asp:UpdatePanel runat="server" UpdateMode="conditional" ID="updatePanel" ChildrenAsTriggers="False">
17 <Triggers>
18 <asp:AsyncPostBackTrigger ControlID="button1" EventName="Click" />
19 </Triggers>
20 <ContentTemplate>
21 <asp:ObjectDataSource runat="server" ID="TestData" TypeName="HSE.HSMS"
22 SelectMethod="GetHoursWorked">
23 <SelectParameters>
24 <asp:Parameter Name="ReportDate" DefaultValue="12/31/2008" />
25 </SelectParameters>
26 </asp:ObjectDataSource>
27 <asp:Label runat="server" ID="label1" />
28 <asp:LinkButton runat="server" ID="button1" Text="update" OnClick="button1_Click" />
29 <asp:GridView runat="server" ID="PlantOpsview"
30 AllowSorting="true" AutoGenerateColumns="true"
31 DataSourceID="TestData" EnableSortingAndPagingCallbacks="true" />
32 </ContentTemplate>
33 <Triggers>
34 <asp:AsyncPostBackTrigger ControlID="button1" />
35 </Triggers>
36 </asp:UpdatePanel>
37
38 </form>
39 </body>
40 </html>
41
Here is the code behind:
1 Partial Public Class test
2 Inherits System.Web.UI.Page
3
4 Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
5
6
7 End Sub
8
9 Protected Sub button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
10 label1.Text = Now.ToString()
11 End Sub
12 End Class
So, now for the issue. the GridView works great. Headers do the AsyncPostBack just fine. The link is rendered as:
<a onclick="javascript:__gvPlantOpsview.callback("0|0|/wEFCEZhY2lsaXR5Iv92yJF8LRbuYb4o9BmAd5EGb9k=|"); return false;" href="javascript:__doPostBack('PlantOpsview','Sort$Facility')">Facility</a>
But the button is rendered as:
<a id="button1" href="javascript:__doPostBack('button1','')">update</a>
No callback event is wired up. Please tell me I'm missing something obvious. I've cut and past this code into a new test project and IT WORKS?!?! But not in my current project. How is this possible?