473,545 Members | 2,001 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Custom web controls

What is the best way to write dynamic controls in ASP.NET 2.0?
Jun 9 '06 #1
4 1761
What do you mean by dynamic controls? Do you mean that you can instantiate
and add them to the page on the fly during a postback? If so, then develop
the control and then to dynamically add it to the page use Page.Controls.A dd
method.

Or, are you talking about creating a control that allows databinding?

Please clarify.

--
-Demetri
"Smokey Grindle" wrote:
What is the best way to write dynamic controls in ASP.NET 2.0?

Jun 9 '06 #2
Controls that I can change the content at runtime... like say I want to talk
to a database, get a list of items, then come back and custom render the
HTML the control will display... what I'm looking for is what is the best
way to do that in .NET 2.0... in .NET1.1 we did this through a "custom web
control" which I dont seem to see in .NET 2.0 anymore
Jun 9 '06 #3
I'm a bit confused by your statment that you did it through a "custom web
control" that you no longer see in 2.0. Which control? (there is no control
called "custom web control").

Secondly it sounds like you just need a user control that has a method which
takes a string as an argument. Pass it the html markup you want.

The user control uses a Literal to render the markup, the method assigns the
Text property of the literal with the html markup.

This way the user control will render any markup you send it.

Is this what you're talking about doing?

--
-Demetri
"Smokey Grindle" wrote:
Controls that I can change the content at runtime... like say I want to talk
to a database, get a list of items, then come back and custom render the
HTML the control will display... what I'm looking for is what is the best
way to do that in .NET 2.0... in .NET1.1 we did this through a "custom web
control" which I dont seem to see in .NET 2.0 anymore

Jun 9 '06 #4
no it is not..

In .NET 1.1 there were custom web controls and custom web control librarie
projects... in these you could do all kinds of dynamic stuff... and packadge
them as a redistributable dll or just use them in your site like a custom
control. In .NET 2.0 the web control library seems to be gone, along with
the custom control.
"Demetri" <De*****@discus sions.microsoft .com> wrote in message
news:0B******** *************** ***********@mic rosoft.com...
I'm a bit confused by your statment that you did it through a "custom web
control" that you no longer see in 2.0. Which control? (there is no
control
called "custom web control").

Secondly it sounds like you just need a user control that has a method
which
takes a string as an argument. Pass it the html markup you want.

The user control uses a Literal to render the markup, the method assigns
the
Text property of the literal with the html markup.

This way the user control will render any markup you send it.

Is this what you're talking about doing?

--
-Demetri
"Smokey Grindle" wrote:
Controls that I can change the content at runtime... like say I want to
talk
to a database, get a list of items, then come back and custom render the
HTML the control will display... what I'm looking for is what is the best
way to do that in .NET 2.0... in .NET1.1 we did this through a "custom
web
control" which I dont seem to see in .NET 2.0 anymore

Jun 9 '06 #5

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

Similar topics

7
2975
by: Shimon Sim | last post by:
I have a custom composite control I have following property
2
2568
by: Suzanne | last post by:
Hi all, I'm reposting this message as I'm experiencing this problem more and more frequently : I really hope someone out there can help me as I've been tearing my hair out on this one for a good while and I'm getting really frustrated now! My problem is this - my custom controls periodically disappear from my
2
1857
by: J R M | last post by:
I've developed a custom control (it's basically a drop-down list and then a couple of textboxes to include meta-data for the selection) that I'm embedding into another custom control (the idea is to allow a dynamic number of control1 to appear in control2). Everything renders correctly, however I could never retrieve data on postback from my...
15
6485
by: rizwanahmed24 | last post by:
Hello i have made a custom control. i have placed a panel on it. I want this panel to behave just like the normal panel. The problem i was having is that the panel on my custom control doesnt accept other controls. The control i drag drop on it becomes the child of my custom control's parent form and not the child of my custom control. Then...
3
1256
by: edurazee | last post by:
I am from C# Winforms background and recently switched to ASP.NET in c#. After working with Winforms applications along with BusinessObjects, O/R Mapping frameworks, and logical layering techniques for months, I am just wondering, should we actually use ASP.NET ubiquitous xyzDataSource controls? We have our specific class-structures like: ...
0
7479
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...
0
7669
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. ...
1
7439
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...
0
7773
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...
1
5343
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3450
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1901
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
1028
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
722
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...

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.