Click here to Skip to main content
15,919,028 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi, I'm programming Asp.net core2 and when I create an .cshtml file, Html tags do not work and are silent ...it means does not autocorrect
sample:

Test cshtml
Razor
@{
    ViewData["Title"] = "Index";
}

    <h1>Index</h1>


What I have tried:

I modified Visual studio, but did not change
Posted
Updated 7-Jan-19 5:07am
v5
Comments
CHill60 7-Jan-19 7:58am    
I can't follow your link (nor would I anyway). Post the html code into your question - you will be prompted to post it as a code block
amir tavakoli 7-Jan-19 8:04am    
Did you understand??

Are you sure "autocorrect" is the term you wanted; could you mean that that it did not update when you changed the page variable?

If you want that H1 to update when you change ViewData["Title"] then you need to change the content to use that variable
Razor
@{
    ViewData["Title"] = "Index";
}

    <h1>@ViewData["Title"]</h1>
 
Share this answer
 
v2
You might need to repair Visual Studio with the Visual Studio Installer, see details here: Razor Language Services - Visual Studio Marketplace[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900