I have a webgrid MVC3 contains 4 columns Name, Address, age & Edit. I want to hide Edit link for row if age is greater than 55. Help me to do it.
Is there any event like OnItemDataBound event?
Thank you
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
No, there is no such concept as events in ASP.NET MVC.
You could use a custom format column.
Model:
Controller:
View:
Obviously the fact that you have hidden the link doesn’t relieve you from the burden to perform the same check against the Age inside the
Editcontroller action given the person id. There’s nothing preventing a user from entering the url of this Edit action directly in his browser address bar.