asp.net - "The name 'HTML' does not exist in the current context" in MVC 3 Views -
i´m starting use "mvc 3" i´m facing little problems. in views, when code this:
@if(request.isauthenticated) { <text>welcome <b>@context.user.identity.name</b>! [ @html.actionlink("log off", "logoff", "account") ]</text> } else { @:[ @html.actionlink("log on", "logon", "account") ] }
the objects @request , @html indicating error: the name 'html' not exist in current context
.
the same occurs @context, @viewbag, @layout, @url , others.
see:
image http://i56.tinypic.com/28s1smp.jpg
but code correctly compiled no errors. problem cannot use intellisense theses objects in views. normal? (i don´t think so). happening?
i have reinstalled mvc 3 framework same still occurs.
note: new project scratch, not mvc 2 migration. occurs both razor engine , aspx.
this web.config in views folder:
<?xml version="1.0"?> <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> <appsettings> <add key="webpages:enabled" value="false" /> </appsettings> <system.web> <httphandlers> <add path="*" verb="*" type="system.web.httpnotfoundhandler"/> </httphandlers> <!-- enabling request validation in view pages cause validation occur after input has been processed controller. default mvc performs request validation before controller processes input. change behavior apply validateinputattribute controller or action. --> <pages validaterequest="false" pageparserfiltertype="system.web.mvc.viewtypeparserfilter, system.web.mvc, version=3.0.0.0, culture=neutral, publickeytoken=31bf3856ad364e35" pagebasetype="system.web.mvc.viewpage, system.web.mvc, version=3.0.0.0, culture=neutral, publickeytoken=31bf3856ad364e35" usercontrolbasetype="system.web.mvc.viewusercontrol, system.web.mvc, version=3.0.0.0, culture=neutral, publickeytoken=31bf3856ad364e35"> <controls> <add assembly="system.web.mvc, version=3.0.0.0, culture=neutral, publickeytoken=31bf3856ad364e35" namespace="system.web.mvc" tagprefix="mvc" /> </controls> </pages> </system.web> <system.webserver> <validation validateintegratedmodeconfiguration="false" /> <handlers> <remove name="blockviewhandler"/> <add name="blockviewhandler" path="*" verb="*" precondition="integratedmode" type="system.web.httpnotfoundhandler" /> </handlers> </system.webserver> </configuration>
thanks!
you try:
close
view
false errors.close
visual studio
wait bit (maybe 30 seconds)
reopen same project
open different
view
1 causing errorsclose
view
, didn't see of similar errors inview
reopen
view
gave problems earlier
Comments
Post a Comment