HTML and CSS Reference
In-Depth Information
eXerCISe 12-1. CreatING the VISUaL StUDIO prOJeCt
1.
Start Visual Studio 2012 and click the new Project link from the Start page.
2.
in the new project dialog box, select the “ASP.nET MVC4 Web Application” template.
Select a location for this project and enter the project name Chapter12 as shown in
Figure 12-1 .
Figure 12-1. Creating the Geolocation project
3.
in the next dialog box, select the Basic template and make sure the Razor view
engine is selected. Click the oK button and the project will be created.
4.
Right-click the Controller folder in the Solution Explorer and select the
Add ➤ Controller links. Enter HomeController for the controller name and select
the Empty MVC Controller template. Click the Add button to create the controller.
5.
Right-click the View folder and select the Add ➤ new Folder links. Enter the folder
name as Home.
6.
Right-click the new Home folder and select the Add ➤ View links. in the Add View
dialog box, enter the name Index, make sure the Razor view engine is selected,
unselect all the check boxes, and click the Add button.
in the Index.cshtml file, replace the empty div that was created, with the
following markup:
7.
<div style = "width:800px; height:50px;">
<span id = "lbl"> </span>
</div>
 
Search WWH ::




Custom Search