add AJAX dynamically
hello fiends,
I have A table in my page with tow columns in 1st I have a GRID and in 2nd col I am a label.
I have a LINKBUTTON in first cell of GRID and I am displaying the the data in Label when I click on LINKBUTTON. I have to make asynchronize call through LINKBUTTON. So what I am doing is:
aspx.cs
protected void gvFiles_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowIndex != -1)
{
//Adding AJAX to asynchronize call.
UpdatePanel UP = new UpdatePanel();
AsyncPostBackTrigger AT = new AsyncPostBackTrigger();
LinkButton lnkbt_show = (LinkButton)(e.Row.Cells[0].FindControl("B1"));
AT.ControlID = "lnkbt_show";
AT.EventName = "RowCommand";
UP.Triggers.Add(AT);
UP.ContentTemplateContainer.Controls.Add(lbl_FileC ontents);
e.Row.Cells[0].Controls.Add(UP);
}
}
Thanks
__________________
DPK..
|