Do not see the controller and model

in views/jump/index have problem.

first rows:

@model IEnumerable<WhislaMvc.Areas.Admin.Models.Jump>
@{
    ViewBag.Title = "Index";
}

@model and ViewBaf - do not see. I take error:

compilation Error Compiler Error Message: CS0103: The name 'model' does not exist in the current context Compiler Error Message: CS0103: The name 'ViewBug' does not exist in the current context

Update: I comment model and ViewBag

@Html.ActionLink("Create New", "Create")

Html not have method ActionLink why????

Answers


From your question description, it shows that, I think you are using Asp.Net MVC 2 and you just tried to use the functionality of Asp.Net MVC 3.

ViewBag comes with Asp.Net MVC 3 (It's feature of Asp.Mvc 3)

There are few suggestions that you can try to avoid compilation error.

  1. Install Asp.Net MVC 3 (Install .Net Framework 4 prior)

  2. Change your project property. (Right Click Web Project -> click 'Properties' -> Application tab -> Target Framework -> Change to .NET Framework 4

Check and Change your web.config as below:

<compilation debug="true" targetFramework="4.0">
            <assemblies>
                <add assembly="System.Web.Abstractions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
                <add assembly="System.Web.Helpers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
                <add assembly="System.Web.Routing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
                <add assembly="System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
                <add assembly="System.Web.WebPages, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
                <add assembly="System.Data.Entity, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
            </assemblies>
        </compilation>

Hope this helps!


All the problems were with the configuration of Web.Config in Area / Admin / Views

WebConfig I get from Views/Web.Config/ is standart.


Need Your Help

How can I export an Oracle table to tab separated values?

perl dbi sqlplus

I need to export a table in the database to a tab separated values file. I am using DBI on Perl and SQL*Plus. Does it support (DBI or SQL*Plus) exporting and importing to or from TSV files?

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.