R
Rick Strahl [MVP]
I have a situation where I dynamically generate a control onto a page via
page insertion in the Render method. I'm handling everything manually on
this control because there's no knowledge at all about the page as this is a
generic framework level Page. It appears to not be possible to add the
control into the Controls collection of the page (only into some other
container which is an unknown to this generic page).
Anyway I have all of this working by forcing my control to fire a Postback
event 'manually' (I generate that code). This all works fine fine IF the
handler is there. IOW, if there's some control on the form that requires
AutoPostback or implicitly uses it like a Linkbutton control.
However, I can't figure out how to dynamically trigger the form to render
the handler if this is not the case.
I've tried to create a control manually and then pass that to
RegisterRequiresPostBack() but it doesn't generate the script block.
Is there some other way to force the Page to generate the __DoPostBack()
function?
For that matter I might be missing something - is it possible to add a
control to a page (not a user control, but a stock control like Label)
without inserting it into a container? It sure would make life easier if I
could just insert a link button instead of genering the HTML manually <g>...
+++ Rick ---
--
Rick Strahl
West Wind Technologies
http://www.west-wind.com/
http://www.west-wind.com/weblog/
page insertion in the Render method. I'm handling everything manually on
this control because there's no knowledge at all about the page as this is a
generic framework level Page. It appears to not be possible to add the
control into the Controls collection of the page (only into some other
container which is an unknown to this generic page).
Anyway I have all of this working by forcing my control to fire a Postback
event 'manually' (I generate that code). This all works fine fine IF the
handler is there. IOW, if there's some control on the form that requires
AutoPostback or implicitly uses it like a Linkbutton control.
However, I can't figure out how to dynamically trigger the form to render
the handler if this is not the case.
I've tried to create a control manually and then pass that to
RegisterRequiresPostBack() but it doesn't generate the script block.
Is there some other way to force the Page to generate the __DoPostBack()
function?
For that matter I might be missing something - is it possible to add a
control to a page (not a user control, but a stock control like Label)
without inserting it into a container? It sure would make life easier if I
could just insert a link button instead of genering the HTML manually <g>...
+++ Rick ---
--
Rick Strahl
West Wind Technologies
http://www.west-wind.com/
http://www.west-wind.com/weblog/