List view paging causing probleam .

Posted by Sahoo under ASP.NET on 8/23/2012 | Points: 10 | Views : 751 | Status : [Member] | Replies : 1
Hi

I have a list view with . I have placed a placeholder inside ItemTemplate of it . I am adding link button dynamically to it .When I am going to other page it is not showing link buttons.

My code are
if (e.Item.ItemType == ListViewItemType.DataItem)
{
var lblDocName = e.Item.FindControl("lblDocName") as Label;
var pnlDocName = e.Item.FindControl("pnlDocName") as PlaceHolder;
if (lblDocName != null)
{
//Add link button dynamically to place holder
var arrButtons = lblDocName.Text.Trim().Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries);
foreach (var arrButton in arrButtons)
{
var lnkBtn = new LinkButton();
lnkBtn.Text = gDownloadtext;
lnkBtn.CommandName = "Download";
lnkBtn.CommandArgument = arrButton;
lnkBtn.ToolTip = arrButton;
lnkBtn.CssClass = "benefitsPageTableBtn";
pnlDocName.Controls.Add(lnkBtn);
}
}
}


How to fix it.




Responses

Posted by: Nadh123 on: 8/23/2012 [Member] Starter | Points: 25

Up
0
Down
place holder wecan add it form
Form1.Controls.Add(pnlDocName);


Mahendra
91-9908699686

Sahoo, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response