Click here to Skip to main content
15,909,652 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi guys,

In my application I have 3 client pages and 1 admin page ...each client page have 1 insert(database) button. Admin have 2 buttons like disable and enable. If the admin click on disable button all the client page buttons will be disable and admin click the enable button all the client page buttons will be visible ....can u guys please help to do it ...

THANKS
Posted

use a data base filed for do that
 
Share this answer
 
Well you could store such information in Session, but I suggest storing such information in database.

for instance

C#
protected void buttonDisable_Click(object sender, EventArgs e)
{
    Session["DisableControls"] = true;
}

protected void buttonDisable_Click(object sender, EventArgs e)
{
    Session["DisableControls"] = false;
}


and in other pages

C#
protected void Page_Load(object sender, EventArgs e)
{
    if(!this.IsPostBack)
    {
        buttonXYZ.Enabled = Session["DisableControls"] != null ? (bool)Session["DisableControls"] : true;
    }
}


I'll repeat myself, I suggest you consider storing such information in DB.
Also read something about Role concept in software.
 
Share this answer
 
v2
Comments
ramuAlla 28-Feb-12 6:27am    
Thanks a lot ..I got the solution with ur help....
Once again thanks ....

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900