M
Michael Dawson
I am creating a list of items which need to be clickable on a web page,
but I am unfamiliar with ASP event handling. I created the following
test control:
public class MyCustomControl : System.Web.UI.WebControls.WebControl
{
//---
public MyCustomControl()
{
// Init the class
}
//---
protected override void Render(HtmlTextWriter output)
{
Button b = new Button();
b.Text = "btn";
b.CommandName = "Keyword_Click";
b.Click += new EventHandler(this.b_Click);
b.RenderControl(output);
}
//---
void b_Click(object sender, EventArgs e)
{
throw new Exception("it works!");
}
}
is it possible to do something like this?
I would appreciate any input on this
Thanks.
but I am unfamiliar with ASP event handling. I created the following
test control:
public class MyCustomControl : System.Web.UI.WebControls.WebControl
{
//---
public MyCustomControl()
{
// Init the class
}
//---
protected override void Render(HtmlTextWriter output)
{
Button b = new Button();
b.Text = "btn";
b.CommandName = "Keyword_Click";
b.Click += new EventHandler(this.b_Click);
b.RenderControl(output);
}
//---
void b_Click(object sender, EventArgs e)
{
throw new Exception("it works!");
}
}
is it possible to do something like this?
I would appreciate any input on this