473,386 Members | 1,969 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.

declaration of web user control

I have made a web user control (.ascx). Now i want when
user drags it on any aspx page , its declaration in the
code behind should come automatically like this :
Private Withevents <UserControl1> as new <UserControl>.
How can i achive this ?

thanks
Nov 19 '05 #1
1 868
Unfortuntely you cant do this with usercontrols. You have to manually
declar teh control in your code behind then (in OnInit) use FindControl to
get teh actual page instance of the control and assign it to the code behind
variable for access.
"vikram" <an*******@discussions.microsoft.com> wrote in message
news:01****************************@phx.gbl...
I have made a web user control (.ascx). Now i want when
user drags it on any aspx page , its declaration in the
code behind should come automatically like this :
Private Withevents <UserControl1> as new <UserControl>.
How can i achive this ?

thanks

Nov 19 '05 #2

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

Similar topics

83
by: Alexander Zatvornitskiy | last post by:
Hello All! I'am novice in python, and I find one very bad thing (from my point of view) in language. There is no keyword or syntax to declare variable, like 'var' in Pascal, or special syntax in...
4
by: Helmut Dirtinger | last post by:
Hi Compontents of an xml file are mapped to the different node types of the xpath data model. An element is mapped to an element node, an attribute node represents an attribute and its value...
8
by: newmans | last post by:
Perhaps one of the experts can straighten me out on this point... In Bjarne Stroustrup's book 'The C++ Programming Language' 3rd Edition, section 4.9, indicates that typedef complex<short>...
1
by: Jun Avendano | last post by:
Hi, Is there a way to prevent automatic declaration of a custom control in the code-behind of an asp.net page? Thanks, Jun
1
by: Dhiman | last post by:
Here is the problem. I have a parant class where I have declared couple of variables for user control that I will be using in the web pages. (ParentPage.vb) This class is inherited by the code...
1
by: Barbara Alderton | last post by:
I have the following scenario: I have a user control that contains a registered menu control. The menu and other information on the user control is specific to the user accessing the site. ...
3
by: Nad | last post by:
Hello, When I add a User Control to a web form and then try to declare it in the code as a private member it doesn't get instantiated. However with 'protected' it's OK! For example I get a...
18
by: noridotjabi | last post by:
Whilest I was browesing a tutorial today I came across the infromation that in standard C variables must be decalred at the beginning of a block. Meaning: ...
18
by: sunny | last post by:
Hi Why does C allows declaration of variable inside switch block. ex: foll prg does not gives "undeclared "b" error msg. but also does not initialize b to 20 int a=1; switch(a) { int b=20;...
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: 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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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,...

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.