Link to home
Create AccountLog in
Avatar of mugsey
mugseyFlag for United Kingdom of Great Britain and Northern Ireland

asked on

how to prevent detailsview going into edit mode if user is not in specific role

What is the best approach to stop a detailsview going into edit mode if the user is not in a specific role -
for example

If (User.IsInRole("Admin"))

then allow the detailsview to go into edit

else

keep it as readonly

I would like a working exmaple please


Avatar of divyeshhdoshi
divyeshhdoshi


If (User.IsInRole("Admin"))
then
   detailsview.editindex=e.neweditindex;
//bind grid here
else
     return;
keep it as readonly
Avatar of mugsey

ASKER

Hi

The detailsview does not have a property
    editindex



ASKER CERTIFIED SOLUTION
Avatar of jandromeda
jandromeda
Flag of Sri Lanka image

Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
SOLUTION
Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account