Click here to Skip to main content
14,297,239 members
Rate this:
Please Sign up or sign in to vote.
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">
    Dashboard

    <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)
    {
    Response.Redirect("Login.aspx");
    }

    AssignUserRight();

    return;
    }

    --------------------------------------------
    function

    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
    }

    }
    else
    {
    this.lblMonitoringError.Text = "Unable To Allocate User Rights, Contact Your Software Developer";
    return;
    }
    }
    Posted
    Updated 23-Jul-19 22:51pm
    Comments
    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

    Rate this:
    Please Sign up or sign in to vote.

    Solution 1

    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"

    example:

  •    

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




    CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100