F
Fadi.MM
Hi Guys,
I'm trying to create a library of ASP.NET user controls.
What i'm trying to do is to encapsulate all my controls in one library
(DLL) and re-using them in other projects. Everything is going fine as
long as the control is only a C# or VB class.
But when it comes to a .aspx based control, I'm not able to use it in
my client projects, of course because the server-side built-in controls
in the aspx (ASP.Textboxes, ASP.dropdown etc..) are not defined in the
client project.
In order to solve this, I have to add those controls one-by-one
programatically using mycontrol.Controls.Add(textbox etc..). This
solution is working fine. But i'm looking for better one:
I'm trying to use the .ascx source file, read it inside my control
class, and render it by overrding the control.render event. But the
server controls are not rendered. I tried to use the RenderChildren
sub, the Render and OnPreRender. but it's seems that all these subs are
working after the page is rendered. I'm getting the source of the .ascx
file written as HTML in the client page after I run it.
Does anybody have clue about this?
Thanks
Fadi
I'm trying to create a library of ASP.NET user controls.
What i'm trying to do is to encapsulate all my controls in one library
(DLL) and re-using them in other projects. Everything is going fine as
long as the control is only a C# or VB class.
But when it comes to a .aspx based control, I'm not able to use it in
my client projects, of course because the server-side built-in controls
in the aspx (ASP.Textboxes, ASP.dropdown etc..) are not defined in the
client project.
In order to solve this, I have to add those controls one-by-one
programatically using mycontrol.Controls.Add(textbox etc..). This
solution is working fine. But i'm looking for better one:
I'm trying to use the .ascx source file, read it inside my control
class, and render it by overrding the control.render event. But the
server controls are not rendered. I tried to use the RenderChildren
sub, the Render and OnPreRender. but it's seems that all these subs are
working after the page is rendered. I'm getting the source of the .ascx
file written as HTML in the client page after I run it.
Does anybody have clue about this?
Thanks
Fadi