ASP.NET v1.1 (VS.Studio 2003)
I add a LinkButton named "lnkExport" and double-click on it.
A method gets created automagically with the following signature:
private void lnkExport_Click(object sender, System.EventArgs e)
{
}
and this gets added to InitializeComponent()
this.lnkExport.Click += new System.EventHandler(this.lnkExport_Click);
All very nice. I add a
Response.Write("Clicked")
in
lnkExport_Click()
to see it working and run the page.
I get a runtime error that
object is inaccessible due to its protection level. I then make
lnkExport_Click()
public and it works.
Why? Why does it need to be public when it is in the same page? All it does is it runs the code as a PostBack AFAIK.
I fail to see why the auto-created private signature does not work.