Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. SharePoint
  4. Web part events firing out of order

Web part events firing out of order

Scheduled Pinned Locked Moved SharePoint
helpcomtutorialquestion
3 Posts 2 Posters 2 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Offline
    J Offline
    JimmyRopes
    wrote on last edited by
    #1

    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

    N 1 Reply Last reply
    0
    • J 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

      N Offline
      N Offline
      Not Active
      wrote on last edited by
      #2

      First I'd say this isn't the way to construct connectable webparts in SharePoint. Look here[^] for a walkthorugh. You don't need to use CreateChildControls, do it in RenderWebPart


      I know the language. I've read a book. - _Madmatt

      J 1 Reply Last reply
      0
      • N Not Active

        First I'd say this isn't the way to construct connectable webparts in SharePoint. Look here[^] for a walkthorugh. You don't need to use CreateChildControls, do it in RenderWebPart


        I know the language. I've read a book. - _Madmatt

        J Offline
        J Offline
        JimmyRopes
        wrote on last edited by
        #3

        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

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups