c# - in _ViewStart,cshtml, how come the Javascript part does not get executed every time when I goto another page? -


in code below located in _viewstart.cshtml, reason, inside @{ } gets executed everytime when goto page, javascript part not, why , how fix it?

<script>       alert("in side viewstate"); </script> @{       layout = "~/views/shared/mylayout.cshtml";  } 

this javascript code has put in mylayout.cshtml, not _viewstart. _viewstart.cshtml special view sets razor variables, not contain html code.


Comments

Popular posts from this blog

php - Why I am getting the Error "Commands out of sync; you can't run this command now" -

linux - Does gcc have any options to add version info in ELF binary file? -

java - Are there any classes that implement javax.persistence.Parameter<T>? -