Click here to Skip to main content
15,920,005 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have 2 users(Admin And Employee) for this application. and i want to give only view means only read only Permission to Employeee.and Add , Edit , Delete permission to Admin.

What I have tried:

I have tried that div id="Content" and runat="server" And in cs page Content.enabled=true but it`s not working.
Posted
Updated 14-Apr-18 18:34pm
v2

1 solution

Yes it is possible to make a div or any html element readonly without using JavaScript in
asp.net.

First make add runat="server" attribute and give a id of your element like following code block
ASP.NET
<div runat="server" id="myDiv"></div>


Second go to cs file and write this following code.
C#
myDiv.Attributes.Add("readonly", "readonly");


Hope, it'll help you. Let me know, it's worked or not.
 
Share this 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