Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Building Controls > I need to build user controls dinamically, is possible?

Reply
Thread Tools

I need to build user controls dinamically, is possible?

 
 
leon
Guest
Posts: n/a
 
      10-13-2004
Hello everybody.

I need to build user controls dinamically into aspx page.

Besides of this, i need to put into each userscontrol different controls,
add to every control its control validators and its events.

If someone has some idea, i will say Thanks a lot.

leon


 
Reply With Quote
 
 
 
 
John Saunders
Guest
Posts: n/a
 
      10-13-2004
"leon" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Hello everybody.
>
> I need to build user controls dinamically into aspx page.
>
> Besides of this, i need to put into each userscontrol different controls,
> add to every control its control validators and its events.
>
> If someone has some idea, i will say Thanks a lot.


You can dynamically "build" a custom server control. That is, you can create
a custom control which dynamically decides which controls it will contain.

It won't be a .ascx file, though.

-----
John Saunders


 
Reply With Quote
 
 
 
 
Sahil Malik
Guest
Posts: n/a
 
      10-13-2004
Leon,

The answer is Page.LoadControl ... but keep reading ..

This is a classic problem even framework 2.0 fails to solve appropriately.

user controls are a combination of ascx and a code behind file in framework
1.1 and a partial class and code beside class in framework 2.0. The way they
work is, in 1.1 inherited code and in 2.0 combined code is compiled at
runtime and an Activator.CreateInstance is called on the URL location of the
ascx, similar to a webservice call .. it is like a server activated object.

So while the ascx interface is fun to play with and intuitive, (etc. etc.),
you cannot do a "new" on a usercontrol. ....

HOWEVER .. you can do a Page.LoadControl which comes darned close.

The only thing you cannot do is put UserControls along with ascx's in a dll
and distribute that as a product. That is not possible to do

- Sahil Malik
You can reach me thru my blog at
http://www.dotnetjunkies.com/weblog/sahilmalik



"leon" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Hello everybody.
>
> I need to build user controls dinamically into aspx page.
>
> Besides of this, i need to put into each userscontrol different controls,
> add to every control its control validators and its events.
>
> If someone has some idea, i will say Thanks a lot.
>
> leon
>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Controls.Count, Controls.IsSynchronized, and Controls.SyncRoot Nathan Sokalski ASP .Net 4 09-05-2007 03:27 AM
using javascript in User controls to access server controls of the user control Faizan Ahmed ASP .Net Building Controls 1 01-04-2005 04:09 PM
using javascript in User controls to access server controls of the user control Faizan Ahmed ASP .Net Web Controls 1 01-04-2005 04:09 PM
I need to build user controls dinamically, is possible? leon ASP .Net Web Controls 3 10-14-2004 10:13 PM
SWsoft Acronis Disk Director Suite 9.0 Build 508, Acronis OS Selector 8.0 Build 917, Acronis Partition Expert 2003 Build 292, Acronis Power Utilities 2004 Build 502, F-SECURE.ANTI vIRUS.PROXY v1.10.17.WINALL, F-SECURE.ANTI vIRUS v5.50.10260 for CITRI vvcd Computer Support 0 09-25-2004 01:38 AM



Advertisments