Click here to Skip to main content
15,918,889 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi Guys,

I have a dropdown list which is created dynamically using c#. I have to make it readonly based on page permission but if i set the property to disabled it can be over ridden by clicking F12 and deleting that property.. Is there any way to prevent it??? Please help me out
Posted

1 solution

First of all. A dropdownlist is always readonly!

The only way to prevent the F12-trick is to not populate any options if the user does not have permissions. Or only populate the 1 option the user is allowed to see.
You create it dynamically, so this should be easy to do.
 
Share this answer
 
Comments
Arjun Menon U.K 18-Jul-12 9:18am    
Alluvial The Problem is am populating the ddl on load and then disabling it.. So is there any other way
StianSandberg 18-Jul-12 9:21am    
No, I don't think there are any other way around this. But it would be quite easy to do like i suggested in my answer?
Arjun Menon U.K 18-Jul-12 9:26am    
Thanks a lot yaar.. Will do it as you told.. Cheers
StianSandberg 18-Jul-12 9:28am    
I think that's the best and safest solution. Then your visitors cant tamper your html source or even look at options they should not see.. Please accept my answer :)

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