473,597 Members | 2,375 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Custom Control Add Control Dynamically.

Hi
Iam new to MS .Net technology just getting along with it....I created a custom control ,which takes in a query and displays the data in a tabular format....somet hing similar to a datagrid.

Since its a custom Control I drag and drop and use it in my Pages. I overload the render method of my Custom Control and I pass the data that is to be displayed.

Now there is a requisite I have to add a Control ( Say for ex a Dropdown List box)
Could you please suggest me how do I add a Web-Control dynamically from a Custom -Control in to the webform.

And someone could please suggest the difference between
A web ( server Control and a Custom Control).
Nov 18 '05 #1
1 1858
"Wannabe_Ge ek" <Wa*********@di scussions.micro soft.com> wrote in message
news:90******** *************** ***********@mic rosoft.com...
Hi
Iam new to MS .Net technology just getting along with it....I created a custom control ,which takes in a query and displays the data in a tabular
format....somet hing similar to a datagrid.
Since its a custom Control I drag and drop and use it in my Pages. I overload the render method of my Custom Control and I pass the data that is
to be displayed.
Now there is a requisite I have to add a Control ( Say for ex a Dropdown List box) Could you please suggest me how do I add a Web-Control dynamically from a Custom -Control in to the webform.

You may want to take a look at the resources at
ASP.NET Server Controls
(http://msdn.microsoft.com/library/de...-us/vbcon/html
/vbconwebformsco ntrolssg.asp). In particular, you'll be creating a composite
control.

And someone could please suggest the difference between
A web ( server Control and a Custom Control).


Those are really two terms for the same thing, except that a Custom Control
is one that you create - it didn't come with .NET.

The other term which confused me as a newcomer was "user control". That's a
different animal, a greatly-simplified custom control with a large number of
restrictions.

You might also be interested in the following, if you'll be writing a lot of
custom controls:

"Developing Microsoft® ASP.NET Server Controls and Components" from
Microsoft Press, by Nikhil Kothari and Vandana Datye
(http://www.microsoft.com/mspress/books/5728.asp)


--
John Saunders
johnwsaundersii i at hotmail

--
John Saunders
johnwsaundersii i at hotmail

Nov 18 '05 #2

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

Similar topics

2
1476
by: anand | last post by:
Hi all, I have created a custom control which displays Image using Graphics.. I am using this control in a different windows application. I am dynamically creating the control and putting that in the form. In the Control's InitializeComponent() function following statement is present
3
6290
by: David Freeman | last post by:
Hi There! I'm having trouble dynamically adding custom controls. My custom controls does not use code-behind but only <script /> block for programming. So as a result, I don't need to compile my custom controls to dll for them to work. But I wonder, if I don't compile to dll, can I still dynamically add that custom control? If so how? Below is how I've tried (and failed). At top of the page...
5
2334
by: Alan Silver | last post by:
Hello, I have a products page that takes a product ID in the query string. Based on the product details (from a database), the page then loads up one of a number of custom controls, calls a method in the control (that displays product info) and then loads the control into a placeholder so it will be displayed. I want to be able to restore the state of the controls in the custom control, but can't get it to work. For example, the...
3
1823
by: bill | last post by:
I am using VS2005 to build a web form dynamically. I'm using AddHandler to connect a custom event handler to the TextChanged event of dynamically added textbox controls. Data entered in the dynamically added textbox controls is saved to a database in the custom event handler. The custom event handler fires when the page posts back. I have a menu control which causes a postback, and the custom event handler then fires if a textbox...
6
11064
by: | last post by:
I have made some user controls with custom properties. I can set those properties on instances of my user controls, and I have programmed my user control to do useful visual things in response to how those properties are set. I want to be able to do two other things: a) add User control instances to my page, filling in the place of placeholder controls, and b) programmatically setting custom properties on those dynamically spawned...
4
2522
by: =?Utf-8?B?TWFyaw==?= | last post by:
Hi, I have built a custom control button which inherits from WebControl and implements IPostBackEventHandler. The control also declares an event Click and provides a method OnClick which invokes the registered delegate. All is fine with my control until I try to add it to the page dynamically in a code behind event handler and wire-up the click event using the normal syntax such that; protected void btnNew_Click(object sender, EventArgs...
3
2308
by: JJ | last post by:
Whats the best way to convert a user control to a custom server control? i.e. I created a .aspx control using the designer to create the look of the control. I now want to use this in other projects and compile it as a dll. However, I understand that I now need to create the controls interface elements via code. Is there a way to easily translate a previously created interface to be created by code? Not sure I am making myself very...
3
1350
by: RichB | last post by:
I would like to use the AJAX ASP.NET Accordion Control. Can I create a user control for the form and include this within a custom control which inherits from a Pane of the Accordion control? I know that I can create a user control and add it within the aspx file or dynamically to a page, but can I do the same within a custom control so that I can reuse this as a whole Pane. I wish to do this so that I can dynamically add new panes with...
4
2474
by: =?Utf-8?B?UmljaEI=?= | last post by:
I am trying to create a project using the ASP.NET AJAX accordion control. I would like to dynamically add panes to the control with a form template added when the pane is added. I have tried unsuccessfully in creating the whole pane as a user control and have succeeded in adding the pane and then dynamically adding the content which is a user control to the pane, dynamically within the page. However I would like to have a single pane...
0
7959
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
7883
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8263
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8021
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8254
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
5421
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
2393
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1492
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1226
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.