user2931015
user2931015

Reputation: 219

disable panel in asp.net

i want to disable panels in asp.net like when manager is login then they cannot able to see supervisor and also manager and supervisor designations are also defined in table like when

1 supervisor
2  manager

and i try this but i try this but i not work

if (Session["UserDesignation"].ToString() == "2")
{
    Manager.Visible = true;
}
else
{
    Manager.Visible = false;
}
if (Session["UserDesignation"].ToString() == "1")
{
    SuperVisiorPanel.Visible = true;
}
else
{
    SuperVisiorPanel.Visible = false;
}

and in login form

int desginid = Convert.ToInt16(aa.spdesign(txt_username.Value, txt_pass.Value));
Session["UserDesignationID"] = desginid;

if (users == 1)
{
    Session["Login2"] = txt_username.Value;
    Session["Login3"] = txt_pass.Value;
    Session["UserDesignationID"] =  desginid;
    Session["UserTypeID"] = users;

    Response.Redirect("AdminOp.aspx");
}
else if (users == 2)
{
    Session["Login2"] = txt_username.Value;
    Session["Login3"] = txt_pass.Value;
    Session["UserDesignationID"] = desginid;

    Session["UserTypeID"] = users;

    Response.Redirect("upload.aspx");
}

here above 1 and code is user type ID

any help?

Upvotes: 0

Views: 3091

Answers (1)

Microsoft DN
Microsoft DN

Reputation: 10020

To enable/disable asp.net panel

SuperVisiorPanel.Enabled = false;
SuperVisiorPanel.Enabled = True;

To hide/show asp.net panel

SuperVisiorPanel.Visible = false;
SuperVisiorPanel.Visible = True;

Upvotes: 1

Related Questions