Hy.
I know that there are no server controls and server-side events, but…:
My app is like an email box and the unread items are bold displayed.

Ok… the bold items are the unread (isRead==false). I want to update the item to (isRead=true) without any click.. just before the page is rendered.
How should I do it? Is there a way in ASP.NET MVC or will I have to do it with JQuery?
.
What is the best way to call a method AFTER “View” rendered?
.
Tks, guys!
Generally once your action has done it’s thing, and you’ve made it to the view, there’s no going back to code (so to speak). There are two ways to approach this problem.
You create a copy of the list of messages to pass to the view and change the original to have
isRead=true. I would say this is the preferred way of solving your problem and the code will look something along the lines of:You now have two collections, a copy of the original data you can pass to the view to render the data correctly, and the other is your original collection with all items updated with
isRead = true.The other option isn’t as good from the design point of view, but it will be able to accomplish the same goal. You can put the code to update the property directly into the view, right below where you do the check if it’s read or not to change the bold. I’m assuming your view looks something along the lines of: