Tuesday, March 13, 2012

Should I Hide Controls or Have Different Pages?

I have a page where two types of users enter a work order. They enter the same stuff except for the following:

User 1 = customer via web

No TextBox for order date, I do that behind the scenes because it's current dateNo TextBox for completion date, that is done on a different page by User 2, when the work order is complete

User 2 = assistant in shop (in store orders)

Needs a Textbox for order dateNeeds a Textbox for completion date

Your ideas? Should I hide the controls based on the user logged in? They both log in? Should I have different pages (this sounds silly) or is there another way I'm not thinking of?

If the only difference on the page is 2 simple textbox controls between the 2 different user types, I personally think that you should just hide/show those text boxes based on who's logged in. If there were more significant differences it would make sense to separate them between pages.

The simplest way to go is to show and hide your controls based on the logged in user especially if your data is not sensitive.

HC


Do I check user and hide/show in the page load?


You can have a personalized page based on the roles (built in ASP .NET 2.0 roles and membership API) and have the controls visible/hidden based on that.

But if these pages use some monetary information i would suggest that you use different forms because you might decide to assign them different access policies using WAT later.

HTH


luvdairish:

Do I check user and hide/show in the page load?

You should set the visible to false by default, then you check for a specified user or a group to show it.

HC

0 comments:

Post a Comment