PDA

View Full Version : [CLOSED] Enable Buttons on Page Load



blueworld
Feb 26, 2014, 2:03 PM
Hi,

this is just out of curiosity,

I am working with user permissions and therefore some buttons like delete-buttons are disabled.

On page_load I am checking if the user has permissions, and if yes I am enabling that Button.

I have seen that there are two ways to do that:



Me.ButtonDelete.Enable()




Me.ButtonDelete.Disabled = False


Is there any difference between these two approaches?

geoffrey.mcgill
Feb 26, 2014, 3:37 PM
Is there any difference between these two approaches?

No, no really.

In general, you should set Properties during Page_Load, and call Methods during DirectEvents/DirectMethods. There is some overlap of Property and Method functionality in Ext JS, which can cause confusion. This Enable() vs .Disabled is one of those overlaps.

These members are even further complicated by the native ASP.NET .Enabled Property. If I remember correctly, there is some hard-coded logic deep inside the native WebControl Rendering event which forced us to work around this (defect?) problem by using .Disabled.

Hope this helps.