User Controls in VS.NET 2003

A

A.M

Hi,

When I drop a ASP.NET control from toolbox into my page, It automatically
puts something like this line in my code behind class defenition:

protected System.Web.UI.WebControls.TextBox TextBox1;

But it doesn't do same thing with user controls.

I have to drag and drop my user control from "SOLUTION EXPLORER" into the
page, and I have to declare the control manually by typing it.

I don't mind to type it; however just in case, Am i missing something ?

Thanks,
Ali
 
G

Guest

No, not missing anything...that's what you have to do

----- A.M wrote: ----

Hi

When I drop a ASP.NET control from toolbox into my page, It automaticall
puts something like this line in my code behind class defenition

protected System.Web.UI.WebControls.TextBox TextBox1

But it doesn't do same thing with user controls

I have to drag and drop my user control from "SOLUTION EXPLORER" into th
page, and I have to declare the control manually by typing it

I don't mind to type it; however just in case, Am i missing something

Thanks
Al
 
S

Scott M.

That's odd, in VS.NET 2002 all you have to do is drag it from the Solution
Explorer on to the page. You don't have to declare it as this is done
automatically for you when you drop it on the page.
 
G

Guest

Afaik, if it's specifically a "user control", as opposed to one of the canned ones already in the toolbox, it's *registered* when you drop it on the form and would show up at run-time, but you need to declare the protected variable if you want to do anything with it in the code-behind. Not sure if that's different from VS 2002 or not

----- Scott M. wrote: ----

That's odd, in VS.NET 2002 all you have to do is drag it from the Solutio
Explorer on to the page. You don't have to declare it as this is don
automatically for you when you drop it on the page
 

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

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,819
Latest member
masterdaster

Latest Threads

Top