0

I have one action in my controller :

public ActionResult ProductSpec()
{
  var pvc = new CMS()
  {
    //blah blah blah
  };
  var count_item = DataContext.GetItemReferences();
  ViewData["ttttt"] = count_item; //8
  return View(pvc);
}

And then I display the ViewData["ttttt"] in my view, but the result is System.Collections.Generic.List1[EWeb.Models.Pro] .

Could anyone tell me how to sovle it please.

1 Answer 1

1

Try:

var count_item = DataContext.GetItemReferences().Count;
Sign up to request clarification or add additional context in comments.

1 Comment

Oh yeah, I missed it. Thanks you so much.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.