Friday, June 4, 2010

Link button inside UpdatePanel always does postback

As we know when a button or image button placed inside an AJAX UpdatePanel control is clicked, post back does not happen. This is because UpdatePanel is supposed to trigger an AJAX call behind.

Surprisingly, when a linkbutton is placed inside a AJAX UpdatePanel, page is posted back? Why?

Solution is very simple. Just set a dummy ID to to control. (This is true especially when controls are created dynamically say in a web part. Just before this control is added to Controls collection, ID needs to be set).

Technorati Tags: ,,,

No comments:

Post a Comment