Home » General, Programming / Coding

LinkButton Inside an UpdatePanel Causes Full Postback – ASP .NET

4 August 2010 2,478 views No Comment

If you place LinkButton inside a repeater which is inside an UpdatePanel, you will get a full postback if you click on the LinkButton.

Solution?
On code behind register the linkbutton inside the repeater for Asynchronous postback.
Like this
foreach (RepeaterItem ri in rpt.Items)
{
if (ri.ItemType == ListItemType.Item || ri.ItemType == ListItemType.AlternatingItem)
{
LinkButton lb = (LinkButton)ri.FindControl("lb");
ScriptManager1.RegisterAsyncPostBackControl(lb);
}
}

Read the original article at Webcosmo Webmaster Forum http://www.webcosmoforums.com/asp/21403-linkbutton-inside-repeater-updatepanel-causes-full-postback-asp-net.html

1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
Loading ... Loading ...

Leave your response!

Add your comment below, or trackback from your own site. You can also subscribe to these comments via RSS.

Be nice. Keep it clean. Stay on topic. No spam.

You can use these tags:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

This is a Gravatar-enabled weblog. To get your own globally-recognized-avatar, please register at Gravatar.