About me an ASP.NET program permissions solution: 1. Define the standard naming of roles, modules, and operations and as three database tables. 2. Prepreter of a list of standard naming methods: Operation module, such as addProduct3. Determine if the user has permission to access the page (this permission adds to the rendezvation) 4. Define the page base class, on the page The prerender method of the base class traverses all operating controls (mainly Button, ImgeButton, LinkButton), but parsing the control name, such as addProduct, resolving, whether the member can add an action to the Product module, So according to the role of the member, the corresponding permissions list can be taken from the data, that is, it can be determined whether or not the button can be displayed. (This protocol may be a relatively long time to find button controls in the traversal page)
Public class basepage: System.Web.ui.page {Protected Override Void OnPrender (Eventargs E) {base.onprender (e); foreach (control ob in this.controls [1] .controls) {if (ob is button) OB .Visible = false;}
}
}