Iam developing a Web project using Asp.net MVC3
I have a Error When click the view page like the following.
Error:Parser Error Message: The 'inherits' keyword is not allowed when a 'model' keyword is used.
Source Error:
|
But i want to use @model @inherits in the same view.
Please Solve my Error.
Regards
NagaRaju T

Sunny SharmaPosted Oct 5, 2013, 6:49 AM
JavaScript runtime error: 'jQuery' is undefined
It simply means that your jQuery file is not being loaded.
Check properly if you've added a reference to jQuery file in your View OR in Master Layout.
Sunny SharmaPosted Oct 7, 2013, 1:56 AM
NAGARAJU TAMADAPosted Oct 7, 2013, 12:48 AM
I solved my Error by aading the following Script
Regards
NagaRaju T
NAGARAJU TAMADAPosted Oct 7, 2013, 12:05 AM
Still I have a Error Like
JavaScript runtime error: 'jQuery' is undefined,
When i clear the namespaces as you said
Here I added predefined css template to Content folder for the sake of predefined master page.
That's why i am using
@inherits System.Web.Mvc.WebViewPage
@using System.Web.Mvc
@using System.Web.Mvc.Html
Iam using the following JQuery Scripts in my code
Sunny SharmaPosted Oct 5, 2013, 7:11 AM
@{ Layout="~/Content/earthlingtwo/_MainLayout.cshtml"; }
@model Mvc3CssApp.Models.InsertSiteModel
and it should work.
NAGARAJU TAMADAPosted Oct 5, 2013, 6:55 AM
Basically.i added a predefined css file to Content folder,for predefined master page.
thats why i used
@inherits System.Web.Mvc.WebViewPage
My View file contails
@model Mvc3CssApp.Models.InsertSiteModel
@inherits System.Web.Mvc.WebViewPage
@using System.Web.Mvc @using System.Web.Mvc.Html
@{ Layout="~/Content/earthlingtwo/_MainLayout.cshtml"; }
When i use @model and @inherits keywords i gets error like
Parser Error Message: The 'inherits' keyword is not allowed when a 'model' keyword is used.
please solve my problem
NAGARAJU TAMADAPosted Oct 5, 2013, 6:43 AM
But it causes the error like
JavaScript runtime error: 'jQuery' is undefined
Sunny SharmaPosted Oct 5, 2013, 6:16 AM
At the first place, @model directive is an extended mechanism of binding the view to a model in ASP.NET MVC3.
in previous version of ASP.NET MVC 3 it was required to derive each view from SYstem.Web,MVC.WebView usin @inherits directive, like:
@inherits System.Web.Mvc.WebViewPage
@model MyModel
Both the keywords are not allowed together as they make no sense. Just remove the line 3:
Line 3: @inherits System.Web.Mvc.WebViewPage
and see if it works.
HTH :)