---
GETTING STARTED WITH VISUAL STUDIO 2012 USING VB LANGUAGE NET FRAMEWORK
PREPARATION
Create a folder structure like C:\projects\vs12vb\site1
STEPS
1) Find the VS Express for Web Application startup link in the Start Menu.
Click the link.
2) Main application window shows up.
3) Select “New Web Site…”
4) New Web Site dialog window.
1. Select Visual Basic.
2. Select .NET Framework 4.
3. Select ASP.NET Empty Web Site
4. Select File System.
5. Browse for the folder path that you have created in PREPARATION step.
Click OK.
5) Project creation is done.
If you check the site1 folder in File Explorer, you will find a new file Web.config is created inside it.
If you view the file content using Notepad, you will see the following:
6) Notice from step 5 that what Visual Studio has done so far is just to create a configuration file in plain text format.
This actually can also be done manually by creating the configuration file (xxxx.config) and copying the following texts into it.
<?xml version="1.0"?>
<!--
For more information on how to configure your ASP.NET application, please visit
http://go.microsoft.com/fwlink/?LinkId=169433
-->
<configuration>
<system.web>
<compilation debug="false" strict="false" explicit="true" targetFramework="4.0" />
</system.web>
</configuration>
|
7) Find the Run button.
Click Run.
8) Debugging Not Enabled error dialog pops up.
Click OK.
9) Web Browser pops up with the localhost address.
You may get HTTP Error because your web site hasn’t got any default page yet.
10) In Solution Explorer Panel,
11) Add New Item dialog window.
1. Select Visual Basic.
2. Select Web Form
3. Leave the name as Default.aspx
4. Leave the two checkboxes unchecked.
Click Add.
12) Add a text “Hello World” to the Web Form.
1) In the Web Form editor window, click the Design Tab
2) Type the text “Hello World” in the <div> box.
13) Run your Web Site again.
(Visual Studio automatically saves the last editing).
14) Stop the running of the Web Site.
15) In the editor window, click the Split tab.
Now, you see both the Web Form and the HTML (Source) codes that make up the Web Form.
16) In the Solution Explorer Panel, find the file Web.Config file.
1. Select the file.
2. The Editor Window automatically shows the content of the file.
3. The content of the file in Step 16 is almost similar to Step 5 except that the value for debug is now set to true.
ADDITIONAL EXERCISE
1) Create a new project for C# using the folder c :\projects\vs12cs\site1 and repeat the above steps.
DOWNLOAD
DISCUSSION
1) The steps to create both vb and c# is almost identical except that, in the Template Section of the New Web Site dialog window, you have to select either Visual Basic or Visual C# options.
2) As a result, the codes generated for the Default.aspx differ in the first line.
3) Refer Step 11.4, we deselect the option for “Code in separate file” and “select Master Page”.
We will discuss this further in the coming tutorials.
4) Visual Studio comes with a runtime-server for development purposes.
5) Before running our Web Site on the runtime-server, Visual Studio gives us an option to allow Debug Mode which will explicitly disclose error description during the runtime.
6) At this point, what Visual Studio did to our Web Site project is to add two files, ie Default.aspx and Web.Config. Actually these two files can be created by any text editor program. We use Visual Studio because it provides tools to assist us to build our project easily and rapidly at later stage.
No comments:
Post a Comment