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
I have this managedContextObject I want to pass from a view controller to another.
I am using cakephp and trying to pass an array from the view to
I try to pass variable from jquery to code c# but something is wrong.
If you try to pass the username/password to OpenVPN from a file via the
I try using FQL Query to fetch count of share from post on facebook
i have two views with view1 calling view2. i need to pass data from
I have a UITableView showing data from a plist file. For this table view,
So, my app reads Data from the text view and then saves it to
Hello I have the following code to retrieve data from my db using nhibernate

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.