473,386 Members | 1,827 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

User Controls in VS.NET 2003

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
Nov 18 '05 #1
6 1333
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

Nov 18 '05 #2
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

Nov 18 '05 #3
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.
"Bill Borg" <an*******@discussions.microsoft.com> wrote in message
news:30**********************************@microsof t.com...
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 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

Nov 18 '05 #4
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.
"Bill Borg" <an*******@discussions.microsoft.com> wrote in message
news:30**********************************@microsof t.com...
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 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

Nov 18 '05 #5
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
"Bill Borg" <an*******@discussions.microsoft.com> wrote in messag
news:30**********************************@microsof t.com..
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, I 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" int 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 somethin

Thanks

Al

Nov 18 '05 #6
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
"Bill Borg" <an*******@discussions.microsoft.com> wrote in messag
news:30**********************************@microsof t.com..
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, I 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" int 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 somethin

Thanks

Al

Nov 18 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: john | last post by:
I searched http://www.sellsbrothers.com. and could not find anything about this subject. How do I make C# User Controls Visible to Visual Basic 6.0 Applications? Thanks, John
9
by: Bob Cummings | last post by:
Greetings I have googled this to no avail, maybe someone here can help. I have a user control that has several radio buttons and text boxes. I place 5 of these user controls on a windows form....
3
by: Kevin Mellor | last post by:
Hello all, I hope someone can help me. I am not new to developing but am new to C# (assemblies etc) and V Studio 2003, although familiar with terminology from VS6. I am in the nightmare...
10
by: BBM | last post by:
Hi, I have been developing with C# User Controls and occasionally have a problem where I "lose" a control from the design surface of the User Control. The controls that I am using to build my...
2
by: Technical Group | last post by:
Friends, Can anybody help me out by sending a piece of C# code showing how to add an active directory user to a particular user group? If the group does not exist, then create it. Thanks in...
13
by: Lloyd Sheen | last post by:
I have now spent 5 hours on google/msdn looking for something useful in the creation of user controls for asp.net. The VS 2003 has very limited support for things such as absolute positioning of...
11
by: Lloyd Sheen | last post by:
Is there any one who has actually done this. I have now scanned more web articles about this with the realization that not one of them (including MSDN docs) outlines how to do this. This is...
5
by: jqpdev | last post by:
Hello all... I'm coming from a Borland Delphi background. Delphi has a specific component called a Data Module. In the designer the Data Module behaves like a windows form. A developer can...
2
by: tshad | last post by:
User VS 2003, I would like to use User Controls to control the page look with 3 User Controls (...PageTop.ascx, ...NavigateTop.ascx and PageBottom.ascx). I would put the Content User control...
2
by: HammRadio | last post by:
I am exploring converting my web app (current Framework 1.1) to Framework 2.0. Everything went smoothly save for one item. To reduce the trips to the database, when loading user controls (like a...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.