This is a migrated thread and some comments may be shown as answers.

RadScheduler FormCreated for any PostBack event

4 Answers 153 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Khanh Phan Van
Top achievements
Rank 1
Khanh Phan Van asked on 31 Aug 2009, 08:40 AM
Hi Telerik,
I have received your answer, but, I just can Closed it, because, there's no Reply button there. So, I create new thread to thank for your supportation and submit new bug, I think this is a bug.
The scenario likes this:

Update panel named UpdatePanel1 contains a RadScheduler named RadScheduler1.
Button1 is outside UpdatePanel1 and be trigged as AsyncPostBack from UpdatePanel1, when click, make RadScheduler1 change to AdvanceInsert mode
Button2 is outside all, and inside UpdatePanel2.

Run project as debug, set break point within RadScheduler1_FormCreated.
Click Button1, after AdvanceInsert form apprear, click Button2. You will be brought to FormCreated event of RadScheduler1.

This will make your application reload many times if there some load data event attach to FormCreated event, and make application run VERY SLOWLY.

I can't attach example to this thread, but everyone can download it from here: http://www.mediafire.com/download.php?zxrt2tijgul

Best regard,


4 Answers, 1 is accepted

Sort by
0
Accepted
Dimitar Milushev
Telerik team
answered on 02 Sep 2009, 01:45 PM
Hi Khanh Phan Van,

When a control postbacks (in this case Button2), the current state of the page is 'reconstructed' on the server. The current state of the page includes the Advanced Edit Form being visible and when the Form is reconstructed the FormCreated event is fired. This ensures that any Controls added during the FormCreated event are also properly recreated during all postbacks while the Edit Form is open. Failing to properly recreate the Control tree of a Page usually results in one or more controls not being able to load their Viewstate followed by a server-side exception.

I hope this sheds some light how Viewstate/Postbacks work and explains why you are observing such a behavior.

All the best,
Dimitar Milushev
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Khanh Phan Van
Top achievements
Rank 1
answered on 03 Sep 2009, 09:29 AM
Thanks for clear explanation from Telerik,

But, this will make the control run very slow. I think Telerik will improve this to make something better.

Best regard,
0
Rebekah
Top achievements
Rank 1
answered on 02 May 2013, 10:08 PM
Dear Telerik,

I am having an issue with the Form of the RadScheduler.  Unfortunately, I have seen other forums on this but no solutions.  From the documentation I have read, it's by design that the Form runs through its complete life-cycle before any user-caused events occur.  From my experience this is true of both server and client side events attached to my problem button.  The AdvandedForm control runs through the life-cycle events after the post back as well so that the order of methods hit for my control are

1. InitControl(),
2. PopulateControl(),
3. Button_Click or function OnButtonClick(),
4. InitControl() and  
5. PopulateControl().

The problem button happens to be the ResetExceptions button on editting a recurring series with exceptions, which seems to work beautifully in the demo at http://demos.telerik.com/aspnet-ajax/scheduler/examples/advancedformtemplate/defaultcs.aspx .  Our code is almost identical to the example's AdvancedForm's markup & .cs file with the javascript files being quite different.  (We do not have any of the Sys.Application.add_init functions in our .js file - mostly validation and setting selected values there.)  Should the AdvancedForm be going through its life-cycle twice every time its opened or postback occurs?  There are other issues too, specifically with view state.  At the recommendation of a Telerik forum, I enabled view state for both the radScheduler and AdvancedForm (both EnableViewState="true" and ViewStateMode="Enabled") and my View State objects are lost every time the control restarts its life-cycle, making it impossible to any sort of IsInitialized property. . .I realize I could go with session, but this seems like a horrible idea on a form that can be opened multiple times with different dataItems.

I imagine there is something that I am missing but have been over this many, many times, also with the help of my colleagues and have not had any success.  Any insight you have into this issue is welcome.

Thank you,
Rebekah Grochowsky


0
Plamen
Telerik team
answered on 07 May 2013, 02:12 PM
Hi Rebekah,

 
Would you please refer to the isolated test web site in this Code Library where this scenario have been isolated and let us know if the unusual behavior can be replicated there as well? 

Kind regards,
Plamen
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Tags
Scheduler
Asked by
Khanh Phan Van
Top achievements
Rank 1
Answers by
Dimitar Milushev
Telerik team
Khanh Phan Van
Top achievements
Rank 1
Rebekah
Top achievements
Rank 1
Plamen
Telerik team
Share this question
or