On Mon, 31 Jan 2005 19:43:02 -0800, =?Utf-8?B?QXNoYQ==?=
<As**@discussions.microsoft.com> wrote:
hello i'm doing this
protected static System.Web.UI.WebControls.Button btnExcel;
hoping that it would remain shared but when i run the application i get
this
error
Compiler Error Message: CS0176: Static member 'NPI.Search.btnExcel'
cannot
be accessed with an instance reference; qualify it with a type name
instead
any other how i can over come this problem?
If you look in the InitializeComponent method you'll notice it is pry
being accessed by the auto-generated code like this:
btnExcel.Text = "Excel";
since it's really an object (instance of a class). I'm not sure why
you're trying to do this, but if you changed the 'protected static'
portion to just 'public' is that good enough?
--
Craig Deelsnyder
Microsoft MVP - ASP/ASP.NET