Incorrect behavour of Admin->Role Administration

This is the place to report bugs and get support. When posting in this forum, please always provide as much detail as possible.

Please do not report problems with a custom build or custom code in this forum. If you are producing your own build from the source code and have problems or questions, ask in the developer forum, do not report it as a bug.

This is the place to report bugs and get support

When posting in this forum, please try to provide as many relevant details as possible. Particularly the following:

  • What operating system were you running when the bug appeared?
  • What database platform is your site using?
  • What version of mojoPortal are you running?
  • What version of .NET do you use?
  • What steps are necessary to reproduce the issue? Compare expected results vs actual results.
Please do not report problems with a custom build or custom code in this forum. If you are producing your own build from the source code and have problems or questions, ask in the developer forum.
This thread is closed to new posts. You must sign in to post in the forums.
3/15/2007 6:52:19 AM
Gravatar
Total Posts 488

Incorrect behavour of Admin->Role Administration

1. Login as admin
2. Go to Admin->Role Administration
3. Press "Edit this Item" icon near any role
4. "Add new role" is showed instead of smth. like role properties

P.S. Also roles cannot be deleted.
3/15/2007 7:18:09 AM
Gravatar
Total Posts 488

Re: Incorrect behavour of Admin->Role Administration

P.P.S. The same problem when trying to edit feature module settings.
3/15/2007 8:29:22 AM
Gravatar
Total Posts 18439

Re: Incorrect behavour of Admin->Role Administration

Your patch which I applied on the 13th caused this bug

Moving the call to LoadPage() out of Page_Load and into On_Init in Default.aspx.cs was the change that broke it.

I moved it back to Page_Load and it works again.

Joe
3/15/2007 8:38:59 AM
Gravatar
Total Posts 488

Re: Incorrect behavour of Admin->Role Administration

Do you know this joke:

Student: here is the answer... but I have lost a sign somewhere.
Professor: do you mean you lost the sign odd number of times?



When calling LoadPage out of Page_Load, all the modules are added to the page after the viewstate is already processed for the page. So, even if I enable viewstate for the page, I cannot use it from any custom module.

It's a major change and could cause some changes of the site behaviour. I shall try to find the reason and create a patch to make it all work with this call form On_Init.
3/15/2007 8:48:02 AM
Gravatar
Total Posts 18439

Re: Incorrect behavour of Admin->Role Administration

I have no problem using viewstate from inside modules I would rather see the code where you are having this problem and see if I can figure out why you are having this issue.

I believe the correct place to load controls is in Page_Load

Joe
3/15/2007 9:12:33 AM
Gravatar
Total Posts 488

Re: Incorrect behavour of Admin->Role Administration

Can you give me an example where do you use viewstate in mojoPortal modules and it works?

In my modules when I move this call to On_Init it works, and don't without it.
3/15/2007 9:29:53 AM
Gravatar
Total Posts 18439

Re: Incorrect behavour of Admin->Role Administration

I use it in FileManager.ascx

I think the issue you are having is that ViewState is disabled by default in Default.aspx.cs according to the Web.config setting DisablePageViewStateByDefault

This is for performance, if a module in the page needs viewstate it is up to the module to call
Page.EnableViewState = true;

in page load of the module

Or if you don't like this behaviour you can set DisablePageViewStateByDefault = false in Web.config

Joe
3/15/2007 9:54:00 AM
Gravatar
Total Posts 488

Re: Incorrect behavour of Admin->Role Administration

1. I have found a solution for modules that works for both calling the function in init and Load. I shall send you a patch in a few days.

2. IMHO adding dynamic controls to the page should not be done on the Load stage.
MSDN suggests even to use PreInit event for this: http://msdn2.microsoft.com/en-us/library/ms178472.aspx

3. DisablePageViewStateByDefault is a strange option. Can you imagine a situation when it should be set to false?
3/15/2007 10:17:29 AM
Gravatar
Total Posts 18439

Re: Incorrect behavour of Admin->Role Administration

1. ok

2. As above, if I agree with your patch and see no problems I'll go along with that change.

3. I found measurable performance improvement by disabling ViewState at the page level in my load tests. Since I generally try to avoid using viewstate even in my modules (I mean I use it but I try to keep it to a minimum) it seems a reasonable setting to me.

In general I try to avoid using postback in the module control but instead try to link to a separate edit page. In some cases use of postback can't be avoided in the module but if it can be avoided I try to avoid it. Modules that use postback have difficulty being cached and may cause strange behavior in other modules that happen to be on the same page during postback. i.e if there is another module on the page using code like if(!Page.IsPostBack)

Joe
3/19/2007 6:36:21 AM
Gravatar
Total Posts 488

Re: Incorrect behavour of Admin->Role Administration

1, 2. I've sent you the patch.

3. I think I was missunderstood.
I agree that it was good to disable page viewstate by default.
I just cannot imagine why one should enable it back.
If no custom modules are used, enabling it doesnothing but worse performance. If custom modules are coded, viestate can be enabled for these custom modules from code.
3/21/2007 5:36:43 PM
Gravatar
Total Posts 18439

Re: Incorrect behavour of Admin->Role Administration

Sorry for the delay in replying.

Thanks for the updated patch!

I think I did misunderstand, anyway I think viewstate is enabled at the Page level by default so I thought you might mean it was odd to disable it.

Cheers,

Joe

You must sign in to post in the forums. This thread is closed to new posts.