Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6070819
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T09:58:37+00:00 2026-05-23T09:58:37+00:00

When I try and pass data to my view from a controller using ViewData

  • 0

When I try and pass data to my view from a controller using ViewData I get the error in the title, when referencing the ViewData property in my view

I am using the Razor View engine, there are several posts around related to this, but they seem to be relevant to web forms implementations

I suspect there is an issue with how Razor is referenced: my config file has a number of warnings:

enter image description here

Those type references are warning : Invalid Module Qualification: Unable to resolve assembly System.Web.WebPages.Razor

The generic MVC stuff is working ok (using only Model references) but trying to access ViewData – no luck

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T09:58:37+00:00Added an answer on May 23, 2026 at 9:58 am

    In MVC3 ViewBag has been added. It’s just the dynamic wrapper around the ViewData. Now you can use something like that :

    ViewBag.Title = "Test"; 
    

    One of the cool benefits of using ViewBag over ViewData is we don’t have to cast ViewBag.Date to DateTime, ViewBag.Post to Post, and ViewBag.Tags to a string array before using them as such. This cuts down on the noise in the view.

    But as Darin said in the comment it’s best to use a strongly typed views.

    Errors you’re getting in web.config are not related to that. However I’m not sure what’s the exact cause for these errors but it seems that it doesn’t affect the application run.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a get-parameter with name controller . When I try to pass it
If you try to pass the username/password to OpenVPN from a file via the
Try loading this normal .jpg file in Internet Explorer 6.0. I get an error
I'm getting this error when I try to pass a task to a Celery
Hello I have the following code to retrieve data from my db using nhibernate
So right now when my app starts I get all of my data from
I've got some data in a view that I would like to pass to
Im getting my data from a web service and loads to a list view.
What is the difference between ',' and 'as' in except statements, eg: try: pass
My compiler behaves oddly when I try to pass a fixed-size array to a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.