Web part events firing out of order
-
I wrote two interrelated web parts. The first (the dashboard) presents a list of open projects and the current state of completion. When a project is selected it passes the project number (only unique identifier) to the second project detail web part (using a session variable) which presents the project details and the appropriate KPIs depending on the project type. Each KPI has a state indicator (blue square - pending, yellow triangle - in progress, green circle - complete and red diamond - behind schedule) and start and end date where appropriate. When a KPI is selected an appropriate (for the particular phase of the project) InfoPath form is presented that represents the things that must be completed to complete that phase of the project life cycle. When the form is submitted control is passed back to the project detail web part so the user can decide if they want to continue on to the next phase or return to the dashboard to work on a different project. The problem I am encountering is that this process usually works but occasionally when it tries to go to a form the user gets a 403 (Not authorized to view this page) error. I put a lot of log messages in the code so I could determine where things went wrong and got a log today indicating that the CreateChildControls method override executed 3 seconds after the RenderWebPart method override executed. I didn't think this was possible but I saw the entries in my log along with time stamps associated with each entry. How can this be possible? I do a lot of processing in the onLoad override in this web part but that is the only difference I can think of that distinguishes this web part from others I have deployed. Could having a lot of processing in the onLoad method cause the other event processors to fire in the wrong order? Has anyone experienced this type of behavior in their custom web parts? I don't have a clue how to fix this situation. Any insight into this problem would be greatly appreciated.
Simply Elegant Designs JimmyRopes Designs
Think inside the box! ProActive Secure Systems
I'm on-line therefore I am. JimmyRopes -
I wrote two interrelated web parts. The first (the dashboard) presents a list of open projects and the current state of completion. When a project is selected it passes the project number (only unique identifier) to the second project detail web part (using a session variable) which presents the project details and the appropriate KPIs depending on the project type. Each KPI has a state indicator (blue square - pending, yellow triangle - in progress, green circle - complete and red diamond - behind schedule) and start and end date where appropriate. When a KPI is selected an appropriate (for the particular phase of the project) InfoPath form is presented that represents the things that must be completed to complete that phase of the project life cycle. When the form is submitted control is passed back to the project detail web part so the user can decide if they want to continue on to the next phase or return to the dashboard to work on a different project. The problem I am encountering is that this process usually works but occasionally when it tries to go to a form the user gets a 403 (Not authorized to view this page) error. I put a lot of log messages in the code so I could determine where things went wrong and got a log today indicating that the CreateChildControls method override executed 3 seconds after the RenderWebPart method override executed. I didn't think this was possible but I saw the entries in my log along with time stamps associated with each entry. How can this be possible? I do a lot of processing in the onLoad override in this web part but that is the only difference I can think of that distinguishes this web part from others I have deployed. Could having a lot of processing in the onLoad method cause the other event processors to fire in the wrong order? Has anyone experienced this type of behavior in their custom web parts? I don't have a clue how to fix this situation. Any insight into this problem would be greatly appreciated.
Simply Elegant Designs JimmyRopes Designs
Think inside the box! ProActive Secure Systems
I'm on-line therefore I am. JimmyRopes -
I did try to move the create code to the render event but I must have done something wrong because an event handler with a Page.Render.Redirect (to go to different InfoPath forms depending on the KPI selected) didn't work when the create code was located in the RenderWebPart event override. I will have to try it again. I do remember doing that in other web parts. Over the past few days I refactored the code so not much is happening in the OnLoad event override and moved the functionality to the RenderWebPart where is is needed. This appeared to have worked but I am still cautiously optimistic. I need to test this application more before I have confidence that it is problem free. Thanks for the link. I'll look into it. I first used the query string but that was problematic so I switched to the session variable. I will look into implementing the connectible web parts described in the link.
Simply Elegant Designs JimmyRopes Designs
Think inside the box! ProActive Secure Systems
I'm on-line therefore I am. JimmyRopes