Web user control

  • Thread starter Samer Y Abu-Jaradeh
  • Start date
S

Samer Y Abu-Jaradeh

Can anyone explain why we don't make instances of objects
in the web application.

Button1 x = new Button1();

Generate error in web application
 
D

Dave Keenan

Without more detail of exactly what error you are getting I can't be sure,
but it looks like you are trying to create an instance of an instance.

i.e. Button1 is already an instance of a button object.

The code you have written would be perfectly valid if you had an object
called Button1 which you were trying to create a new instance of, however I
think what you have is an instance of a Button class called Button1 on your
page.

Dave
 
V

Victor Garcia Aprea [MVP]

Hi Samer,
Please always include a complete error message with every post, that really
helps the guessing game.

--
Victor Garcia Aprea
Microsoft MVP | ASP.NET
Looking for insights on ASP.NET? Read my blog:
http://obies.com/vga/blog.aspx
To contact me remove 'NOSPAM'. Please post all questions to the newsgroup
and not by private mail.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,776
Messages
2,569,603
Members
45,190
Latest member
ClayE7480

Latest Threads

Top