Define JavaScript variable in cshtml view already been declared – Asp.net
I define a variable in an IndexJson.cshtml view: @section Scripts{ @await Html.PartialAsync("_ValidationScriptsPartial") <script type="text/javascript"> var area = "@ViewContext.RouteData.Values["area"].ToString()" </script> If I leave the view and then revisit it then I get: Identifier 'area' has already been declared I have a…