3

The question might be a likely duplicate of Can't access ViewBag in a partial view in ASP.NET MVC3, but it does not seem to categorically negate the possibility.

The issue is to Access ViewBag Data in partial View which is being called from within the View and is being passed a model e.g.

@Html.Partial("name", object); 

The the Action method for the main View from which this partial View is being called has a Viewbag property .. That Viewbag does not seem to be accessed with the Partial view.

Any help appreciated..

3
  • Did you see any errors, when you run your application ? Commented Mar 5, 2013 at 12:05
  • the object is intended to be casted to int .. when doing that, it says that a null object cannot be casted to non-nullable type int (or a similar error :) ) Commented Mar 5, 2013 at 12:07
  • that does not seem to be the case :) Commented Mar 5, 2013 at 12:13

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.