ASP NET 4 BASICS USING VISUAL STUDIO 2012 Part 1
PRE-REQUISITE
1) This tutorial is based on Visual Studio 2012 running on Windows 7. (http://setup-steps.blogspot.com/2014/01/visual-studio-2012-express-for-web.html )
STEPS
1) Create new Web Site.
2) New Web Site options.
1. Template Language: Visual Basic.
2. .Net Framework: 4
3. Template Types: ASP.NET Empty Web Site
4. File Location: File System
5. Path: C:\projects\vs12vb\sitevb101
3) Project creation is done.
Visual Studio automatically creates the folder structure in Step 2.5 above:
4) Look at the Solution Explorer panel.
Visual Studio 2012 automatically creates two files:
1. Web.config (created in c:\projects\vs12vb\vbsite101\) – This file keeps the setting of your web site.
2. vbsite101.sln (created in C:\Users\your-username\Documents\Visual Studio 2012\Projects\vbsite101\vbsite101.sln) – This file keeps the Visual Studio settings with regard to your web site.
5) Add a Web Form item.
It can be added from two points:
A) Solution.
B) Web site.
6) Add New Item dialog window.
1. Language: Visual Basic.
2. Type: Web Form.
3. Name: Default.aspx
4. File Type: separate code (NO), master page (NO)
Click Add.
7) Editing Default.aspx
1. In Solution Explorer panel, click the file Default.aspx
2. In the Properties Panel, the physical path to the file is shown.
3. The main panel shows the file content is Source mode.
4. The file name is displayed on top of the panel.
8) Adding item in Design mode.
1. Click Design tab.
2. Click Div element.
3. Click the div box and type “Hello World”
9) Run the web site.
Click the Run button.
Visual Studio automatically save your last editing.
10) Debugging Not Enabled dialog window.
Click OK.
11) Internet Explorer automatically loads the page on localhost address.
The port number 49175 is generated at random.
12) Switch to Visual Studio.
1. Click the Stop button to stop the web site execution from running on localhost. Alternatively, closing Internet Explorer also stops the web site execution.
2. Take note that, during run time an item “Script Documents” is added to the Solution. This item will go away when you stop the web site execution
13) Inspect the Web.config
1. Click the file Web.config in Solution Explorer panel.
2. The file content is displayed in Code Window.
Notice the debug value is true (as a result of Step 10 above)
14) Close the solution.
ADDITIONAL EXERCISE
Create the same project using C# Language using the following folder structure:
C:\projects\vs12cs\cssite101
DOWNLOAD
Completed Solution: https://drive.google.com/file/d/0B86b-ALn-1MGNVB3WDV6SWRzdGc/edit?usp=sharing
---
No comments:
Post a Comment