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 7714751
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T02:12:35+00:00 2026-06-01T02:12:35+00:00

I’m having an excessively strange issue. I’m working on a project and it’s being

  • 0

I’m having an excessively strange issue.

I’m working on a project and it’s being converted to use asp.net MVC.

Everything works the controllers/models/views. I get every keyword possible in the controller (ViewBag, ViewContext, etc.).

In my views, however, I only get some helpers (e.g. @Model, @Html), but I’m missing others (@model, @ViewBag, @ViewContext, etc.)

It’s an enormous hinderance (i’d post code but I don’t know what code is really relevant). My web.config is 100% dead-on and all of my other MVC projects do not have this issue.

  • Web.Config is correct(in the Views folder)
  • Target framework is correct
  • I have access to all of the methods in my controllers

I’ve cleaned the project/re-mapped it, etc. Others on other machines do not have this issue, but oddly I do (I’ve entirely re-checked out the project).

Like I said, i don’t know what code is relevant I’m just hoping someone else has an idea as what can be wrong. I’m baffled since the web.config is right, i’m not missing any references (all my references are pointing to the correct location), and I can use all of them in the controller.

Just because I don’t want to get yelled at, here’s an excerpt from my web.config in the Views/ folder

<configuration>
  <configSections>
    <sectionGroup name="system.web.webPages.razor" type="System.Web.WebPages.Razor.Configuration.RazorWebSectionGroup, System.Web.WebPages.Razor, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
      <section name="host" type="System.Web.WebPages.Razor.Configuration.HostSection, System.Web.WebPages.Razor, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" />
      <section name="pages" type="System.Web.WebPages.Razor.Configuration.RazorPagesSection, System.Web.WebPages.Razor, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" />
    </sectionGroup>
  </configSections>

  <system.web.webPages.razor>
    <host factoryType="System.Web.Mvc.MvcWebRazorHostFactory, System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
    <pages pageBaseType="System.Web.Mvc.WebViewPage">
      <namespaces>
        <add namespace="System.Web.Mvc" />
        <add namespace="System.Web.Mvc.Ajax" />
        <add namespace="System.Web.Mvc.Html" />
        <add namespace="System.Web.Routing" />
      </namespaces>
    </pages>
  </system.web.webPages.razor>

One of the strangest issues i’ve ever experienced :O

Sample:

@model Project.WebUI.Models.MyModel

@{
    ViewBag.title = "hi";
}

<div>@Model.someItemInTheModel</div>

model is red underlined ‘does not exist in current context’

@model Project.WebUI.Models.MyModel

ViewBag is red underlined ‘does not exist in current context’

ViewBag.title = "hi";

This line is perfectly fine

<div>@Model.someItemInTheModel</div>

Controller, this is all perfectly fine

public ActionResult MyView(long date)
{
   MyModel model = new MyModel();
   model.someItemInTheModel = "hi";
   return PartialView(model);
}
  • 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-06-01T02:12:37+00:00Added an answer on June 1, 2026 at 2:12 am

    Create a new MVC3 project and compare those web.config files to the ones in your project. You’ll need the check the in the project root (/web.config) and in /Views/web.config.

    Also check to make sure you have all of the same System.Web.* references.

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

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I am trying to understand how to use SyndicationItem to display feed which is
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I want use html5's new tag to play a wav file (currently only supported
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
We're building an app, our first using Rails 3, and we're having to build
I have an MVC Razor view @{ ViewBag.Title = Index; var c = (char)146;
I'm having trouble keeping the paragraph square between the quote marks. In firefox the
I'm trying to use string.replace('’','') to replace the dreaded weird single-quote character: ’ (aka
I'm working with an upstream system that sometimes sends me text destined for HTML/XML

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.