Click here to Skip to main content
15,169,249 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Dear All, i am very thankful to all of you and this platform as this forum is providing solutions in a very short time.

Here is my another question.

Background of Question: After authentication of user, system will fetch the user right against userid (one who is logg in) and on the basis of these rights the system will lock and unlock the list index

What I have tried:

the page where i have made menu work

<asp:content id="Content2" contentplaceholderid="MenuPlaceHolder" runat="Server">

  • Dashboard

  • Change Password
  • Suggestions/Comments
  • Logout
  • <asp:content id="Content3" contentplaceholderid="TitleMenu" runat="Server">

    <asp:content id="Content4" contentplaceholderid="ContentPlaceHolder2" runat="Server">
    calling function

    protected void Page_Load(object sender, EventArgs e)
    if (Session["Is_User_Currently_Log_In"] == null)




    public void AssignUserRight()
    DataTable dt = new DataTable();
    dt = (DataTable) Session["S_User_Rights"];

    if (dt.Rows.Count>0)
    int intTotalRecFound;
    string strUserCanChangePassword;
    string strUserCanComment;
    string strUserCanHandleSetting;

    strUserCanChangePassword = "No";
    strUserCanComment = "No";
    strUserCanHandleSetting = "No";

    intTotalRecFound = dt.Rows.Count;
    string strTempUsrRight;
    strTempUsrRight = "";

    for (int i = 0; i < intTotalRecFound; i++)
    strTempUsrRight = dt.Rows[i][0].ToString();
    if (strTempUsrRight=="User Can Change Password")
    strUserCanChangePassword = "Yes";

    if (strTempUsrRight == "User Can Handle Setting")
    strUserCanHandleSetting = "Yes";

    if (strTempUsrRight == "User Can Comments")
    strUserCanComment = "Yes";

    if (strUserCanHandleSetting=="Yes")
    this.(here i want To know how to pick that List index) Recordings

    this.lblMonitoringError.Text = "Unable To Allocate User Rights, Contact Your Software Developer";
    Updated 23-Jul-19 23:51pm
    Richard Deeming 18-Jul-19 11:36am
    Why are you re-inventing the wheel? Just use ASP.NET Identity[^] to handle your authentication and authorization.

    1 solution

    I have myself resolved the problem....

    the very 1st thing you have to do is to make id for the list index
  • and 2nd you have to add runat="server"



    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