Remember those old movies where there was someone bragging and saying something like “hey, look! no Hands!” while riding a bike (or something like that)? Well, I”m going to do something similar :,,) Look at me: only one hand (sorry, but it looks like Vista”s voice recognition isn”t still working out as it should and, that being the case, I do need one hand to write :)), no postback triggers, a link button within an UpdatePanel and a full postback. Don”t believe me? Run this code:
<%@ Page Language=”C#” %>
<form id=”form1″ runat=”server”>
<asp:ScriptManager id=”manager” runat=”server” />
<asp:UpdatePanel runat=”server” id=”panel”>
<asp:LinkButton runat=”server” Text=”Full postback” />
Ok, I cheated :). the truth is that I”m using both hands (which means that you”ll be getting a full postback with the previous sample).
Next question: why? well, simply look at the code you”re getting on the client (only the LinkButton control):
<a href=”__doPostBack(”ctl03”,””)”>Full postback</a>
Noticing anything strange? I do! note that even though the server control generates an ID it will only be inserted on the client HTML control if you explicitly set the ID porperty on the server control. So, if you add the ID to the control everything works ou as expected. If you don”t, then the PageRequestManager won”t be able to find the control (remeber, it doesn”t have an ID and all the work that is done is by the PageRequestManager is based on finding the control through the ID)
Good news to the AJAX team: this isn”t really your fault!
Bad news to the ASP.NET team: this is your fault!
If you really think about it, the AJAX team can be seen as subset of the ASP.NET team 🙂 …