1
In a GridView
users, if the user himself clicks edit/delete his own account, he would like to know how to hide the Row or disable the GridView
but only for the logged-in user, or if clicking the edit/delete button gives an error to prevent the user from being deleted/edited.
I tried something like this:
if (IDUtilizador == Convert.ToInt32(Session["IDUtilizador"]))
{
lblUtilizadoresInfo.ForeColor = System.Drawing.Color.Red;
lblUtilizadoresInfo.Text = "Operação mal sucedida, para alterar as definições de newsletter, acesse Front Office, 'Minha Conta', 'Assinaturas'.";
lblUtilizadoresInfo.Visible = true;
MultiViewContentInfo.Visible = true;
GridViewManage.DataBind();
}
}
But that way whenever I click the back button of the browser I can edit this user, being a huge bug.
Thank you.
It was already solved, it was an error between Userid Séssions.
– Chirag Geiantilal