Wednesday, March 28, 2012

LinkButton and AJAX

<asp:UpdatePanelID="menuUpdate"runat="server">

<ContentTemplate>

<divid="menuRow"runat="server"class="menuRow">

</div>

</ContentTemplate>

</asp:UpdatePanel>

The above is in my ASPX file. I am adding linkButtons to MenuRow during the PAGE_LOAD on the server. The resulting HTML is as follows:

<div id="ctl00_menuUpdate">
<div id="ctl00_menuRow" class="menuRow">
<a class="menuRow1" ID="cell189" runat="server" href="http://links.10026.com/?link=javascript:__doPostBack('ctl00$ctl05','')">Home</a></div>
</div>

I dont want this to refresh the page. I have a Click event for that linkButton and it is executing, but it is also sending the whole page back to the server, not just the updatePanel.

Any thoughts?

I was assigning the ID via Attributes.Add('ID','someValue') and I needed to set the ID via this.ID.

Works as advertised.

Thanks.

No comments:

Post a Comment