onbuttonclick error after setting buttons to invisible

2 posts, 1 answers
  1. Pat
    Pat avatar
    10 posts
    Member since:
    Mar 2010

    Posted 13 Apr 2010 Link to this post

    Here's the scenario.

    Our project uses a toolbar that is for the most part generic (ascx), however for specific modules that you enter some buttons are visible where other modules have different buttons that are visible.  To handle this we are building the toolbar declaratively with all module specific Buttons hidden.  Then in the Page_Load event we are setting the specific module buttons visibility to true.  If a submodule is entered (just another aspx page)  there's code that goes and hides some of the buttons that were set to visible true previously in the same Page_Load.

    When the toolbar has a certain number or order of buttons removed (visibly they look correct) the server-side buttonclick event gets a nasty error.  We have been trying to figure out if this is an ordering issue (of when we are creating/showing/hiding buttons) or because we are creating the toolbar declaratively and then modifying the visibility programmatically (assumed unlikely).

    Any ideas would be greatly appreciated.  Thank you!
  2. Answer
    Pat
    Pat avatar
    10 posts
    Member since:
    Mar 2010

    Posted 13 Apr 2010 Link to this post

    Odd... Where I am setting the toolbar buttons visibility to visible and then back to invisible (both in Page_Load), I needed to only set the module specific buttons to visible on postback and then not hide the buttons not shown in the submodules.

    So the following is the order of what's happening

    Declare all RADToolbarButtons in aspx

    Then in Page_Load:

    Show Module buttons

    If (!isPostback)
        Hide Buttons restricted from submodule


    It works!
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top