As the title says my aim is to implement pagination on my datalist control.
Here is my function from which im fetching the data.
public void LinkButton_Click(object sender, EventArgs e)
{
DrugDescriptionList.DataSource = null;
DrugDescriptionList.DataBind();
LinkButton l = (LinkButton)sender;
string FirstLetter = l.Text;
IBAL objbal = BALFactory.UIFactoryBAL.retrieveDrugNamesObject();
pg.DataSource = objbal.retrieveDrugNames(FirstLetter).DefaultView;
pg.AllowPaging = true;
pg.PageSize = 2;
pg.CurrentPageIndex = CurrentPage;
lnkbtnNext.Enabled = !pg.IsLastPage;
lnkbtnPrevious.Enabled = !pg.IsFirstPage;
DrugNameList.DataSource = pg;
DrugNameList.DataBind();
doPaging();
}
Here is another set of EventHandlers from which im supposed to call the "LinkButton_Click" (above shown)
protected void dlPaging_ItemCommand(object source, DataListCommandEventArgs e)
{
if (e.CommandName.Equals("lnkbtnPaging"))
{
CurrentPage = Convert.ToInt16(e.CommandArgument.ToString());
}
}
protected void lnkbtnPrevious_Click(object sender, EventArgs e)
{
CurrentPage -= 1;
}
protected void lnkbtnNext_Click(object sender, EventArgs e)
{
CurrentPage += 1;
}
I have tried many methods but im getting error bacause of the arguments(object sender and EventArgs e)
Please help me out on how to call that function. Thanks a lot :D
In my case its different becz i have used an object SENDER I would have to convert the "sender" from .aspx to Linkbutton type while calling it elsewhere, which i dont no how to
LinkButton l = (LinkButton)sender; <--- I get an error in this line
My Question is- wat are the arguments to be passed while calling a event handler function from another event handler ?