Thursday, 5 September 2013

How to read cookie in view MVC3?

How to read cookie in view MVC3?

I have a list of comment objects in the view. Each comment has one cookie
that mark the status from user action. Example: like, spam,...
In the view, I want to read the corresponding cookie of each comment to
display the right view to user. Example: user A who liked comment B then
the view will display the unlike button
I don't want to read cookie in the controller because the return data is a
list of comment objects.
My question is how to read cookie directly in view of MVC3?

No comments:

Post a Comment