Diaa Arfan

Laziness, Impatience, and Hubris

Page.GetPostBackEventReference Method

Page.GetPostBackEventReference returns a string that can be used in a client event to cause postback to the server. The reference string is defined by the specified Control object ex: Page.GetPostBackEventReference(Control)

This will allow adding postback to any HTML Element.

It is very helpful in case you are mixing the use between ajax webservice calls and update panels. It will allow you to refresh/update any update panel from any HTML element on the page by adding postback of a button inside the update panel to the HTML element.

example:

<a onclick="<%=Page.GetPostBackEventReference(ButtonContol)%>;">Refresh</a>

the ButtonControl must be a server side control button placed inside the update panel or specified as trigger for the update panel.

Comments

No Comments

Leave a Comment

(required) 

(required) 

(optional)

(required)