I am new in MVC3 Razor and want to show running time on a view (index.cshtml). I use a javascript function and put it in _Layout.cshtml so all other \"home\" views can use
You should move the code from _Layout.cshtml into a seperate .js file and add a reference to it.
Also, you should change the index.cshtml code to be this:
@section SideBar { Add Job About The time is: }
The time is:
JS Fiddle Example