Click here to Skip to main content
15,881,812 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Readonly not working .
I wrote code for read only in MVC application like this but read only not working. please give the solution
HTML
@Html.DropDownListFor(model => model.DocumentType, new SelectList(Model.DocumentInfo, "DocumentType", "DocumentType"), new { @readonly = "readonly" }))
Posted
Updated 13-May-14 21:30pm
v2
Comments
DamithSL 14-May-14 3:46am    
@Html.DropDownListFor(model =>
model.DocumentType,
new SelectList(Model.DocumentInfo, "DocumentType", "DocumentType"),
new { @disabled = "disabled" })
deepakaitr12345 14-May-14 10:38am    
HI @vulisiramu

be careful while using the read-only and disabled because one is posting the values to controller and another will not post the values to controller.

Hope this will help you.

Thanks
vulisiramu 15-May-14 6:27am    
I need to pass the value to controller. which one is better?

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