asp.net web pages

There are 2 entries for the tag asp.net web pages

Using QUnit with Razor Layouts

Given how central JavaScript is to many modern web applications,  it is important to use unit tests to drive the design and quality of that JavaScript. But I’ve noticed that there are a lot of developers that don’t know where to start. There are many test frameworks out there, but the one I love is QUnit, the jQuery unit test framework. Most of my experience with QUnit is writing tests for a client script library such as a jQuery plugin. Here’s an example of one QUnit test file I wrote a while ago (so you know...

Defining Default Content For A Razor Layout Section

Layouts in Razor serve the same purpose as Master Pages do in Web Forms. They allow you to specify a layout for your site and carve out some placeholder sections for your views to implement. For example, here’s a simple layout with a main body section and a footer section. <!DOCTYPE html> <html> <head><title>Sample Layout</head> <body> <div>@RenderBody()</div> <footer>@RenderSection("Footer")</footer> </body> </html> In order to use this layout, your view might look like. @{ Layout = "MyLayout.cshtml"; } <h1>Main Content!</h1> @section Footer { ...