User Controls in VS.NET 2003

  • Thread starter Thread starter A.M
  • Start date Start date
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
 
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
 
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.
 
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
 
Back
Top