Hello,
I am a little confused with the use of classes. I have added a class which inherits from ITemplate for adding an object to the gridview's template and I need to add a click event to that object which inherits from System.Web.UI.Page because I need parameters
which are in Page scope. How can I accomplish it?
This is the code:
public partial class Default : System.Web.UI.Page
{
private void CreateTemplate()
{
int count = gvScores.Columns.Grid.DataColumns.Count();
for (int i = 0; i < count; i++)
{
((GridViewDataColumn)gvScores.Columns.Grid.DataColumns[i]).DataItemTemplate = new MyLinkButtonTemplate();
}
}
}
class MyLinkButtonTemplate : ITemplate
{
public void InstantiateIn(Control container)
{
LinkButton lb = new LinkButton();
GridViewDataItemTempl ...
Go to the complete details ...