Difference between manual rendering and rendering by aspx
-
hello all, i have the following problem: in a page i render the html output of a calendar control manually by
cal.render(writer)
in first second it look ok but unfortunately there is no functionality rendered to the output. That means no links, no script code, ... Is there a trick to render the needed java script code to the resulting HTML? thanks, bernd -
hello all, i have the following problem: in a page i render the html output of a calendar control manually by
cal.render(writer)
in first second it look ok but unfortunately there is no functionality rendered to the output. That means no links, no script code, ... Is there a trick to render the needed java script code to the resulting HTML? thanks, berndhmm, you may think this does not make sense, but i try to create some aspx stuff by ironPython and so i haven't not a real aspx enviroment. That means i haven't a page_load event or something like that. Does someone of you know some details about the rendering process of webcontrolls in common? For example which method renders script code, who call's this method and when is it called? i'll be happy about any suggestion. Thanks Bernd
-
hmm, you may think this does not make sense, but i try to create some aspx stuff by ironPython and so i haven't not a real aspx enviroment. That means i haven't a page_load event or something like that. Does someone of you know some details about the rendering process of webcontrolls in common? For example which method renders script code, who call's this method and when is it called? i'll be happy about any suggestion. Thanks Bernd
Hi there, You may want to look at the Page Object Model[^] and Page Life Cycle[^] that may give you some ideas. Basically, the common script which can be reused in the web page will be emitted by the Page instance, and the control-specific script can be rendered by the control itself. Which script are you talking about?
-
Hi there, You may want to look at the Page Object Model[^] and Page Life Cycle[^] that may give you some ideas. Basically, the common script which can be reused in the web page will be emitted by the Page instance, and the control-specific script can be rendered by the control itself. Which script are you talking about?
hey minhpc_bk, nice to read you! i.E the function '__doPostBack' and all call's to that function are missing. actualy no links aren't rendered. you can take a look at www.gmc.li. First i'll check out your posted link's. thanks, bernd -- modified at 10:29 Monday 2nd October, 2006 stop - the function will be rendered!! In my control isn't set the Property 'Page' which can explain a lot ;) -- modified at 16:51 Monday 2nd October, 2006 false alarm :( the script was rendered by another aspx control. still with no idea. isn't there a property 'enableClientScripting' ore something else? Please take a look at the code[^] here, maybe one of you can see my big mistake.
-
hey minhpc_bk, nice to read you! i.E the function '__doPostBack' and all call's to that function are missing. actualy no links aren't rendered. you can take a look at www.gmc.li. First i'll check out your posted link's. thanks, bernd -- modified at 10:29 Monday 2nd October, 2006 stop - the function will be rendered!! In my control isn't set the Property 'Page' which can explain a lot ;) -- modified at 16:51 Monday 2nd October, 2006 false alarm :( the script was rendered by another aspx control. still with no idea. isn't there a property 'enableClientScripting' ore something else? Please take a look at the code[^] here, maybe one of you can see my big mistake.
To work around the error of not being placed outside the server form element, you'll have two options here: + Extend the Page class, override the
VerifyRenderingInServerForm
method and leave it empty. + Extend the Calendar control and override theRender
method to skip the calling to theVerifyRenderingInServerForm
of the Page instance. Below is the sample code for the first option which IMO is much simpler:public class ExPage : Page
{
public override void VerifyRenderingInServerForm(Control control)
{
//Leave the method empty instead of
//making sure the control is not placed outside the server form.
}
}