By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,827 Members | 2,195 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,827 IT Pros & Developers. It's quick & easy.

Custom web controls

P: n/a
What is the best way to write dynamic controls in ASP.NET 2.0?
Jun 9 '06 #1
Share this Question
Share on Google+
4 Replies


P: n/a
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.Add
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

P: n/a
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

P: n/a
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

P: n/a
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*****@discussions.microsoft.com> wrote in message
news:0B**********************************@microsof t.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 discussion thread is closed

Replies have been disabled for this discussion.