Link to home
Start Free TrialLog in
Avatar of Sirdots
Sirdots

asked on

Mvc 3 : How to return a variable from a method to an action result and dispay in view.

I will like to pass a variable "totalCount" from a method to an ActionResult index view. I will like to show the variable in a text area in the view. How can I achieve this ? My code is attached.
I am using mvc 3
Question.txt
Avatar of Roopesh Reddy
Roopesh Reddy
Flag of India image

Hi,

You can try using ViewBag. Unfortunately, i'm not able to give you the code for it!

You can refer this article - http://rachelappel.com/when-to-use-viewbag-viewdata-or-tempdata-in-asp.net-mvc-3-applications

Hope it helps u...
Avatar of Sirdots
Sirdots

ASKER

I've requested that this question be deleted for the following reason:

No good answer.
ASKER CERTIFIED SOLUTION
Avatar of Mihai Stancescu
Mihai Stancescu
Flag of Romania image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Sirdots

ASKER

Thanks