Once we've done the installation of Visual Studio (2005/2008/2010), now is the time we create a web application with ASP.NET and C # for the first time. We will create an interactive web application that has a fairly simple function also is to receive input (input) from the user (users) in the form of the name and gives the output (output) form of greeting to the person whose name is given. Although it looks simple, but this exercise has a purpose and benefits include:
1. Provide basic example web application creation using ASP.NET and C #.
2. Knowing the form of programming web applications using ASP.NET and C #.
3. Introducing the use of some ASP.NET controls like TextBox, Button, and Label.
4. Introducing the C # programming related processing the sentence (string)
Preparation
The first step we will do is create a Web Project. We start this first exercise by opening the Visual Studio. After Visual Studio is opened, follow these steps:
1. Select File menu
2. Select New Project menu, then Visual Studio will bring up the New Project dialog
3. In the Project Type, select Visual C #. This will result in changes to the existing list of items in the template.
4. In the section Templates, select ASP.NET Web Application.
5. In the Name, write PoertyWeb1, this is the name that we created a web project.
6. In the Location section, select the location where to store our project file. I recommend to create
their own project file storage location for example that I created in D: \ VS2008.
7. In the Solution Name field, automatically, Solution name will be tailored to our project web
name is akbarWeb1. Change the name into akbarSolution1.
8. In the Create directory for solution, make sure the checkbox is already checked.
9. Click the OK button. So the first web project we are ready for our program
and Default.aspx file will automatically be opened for us to start working.
To understand the structure of the project file created by Visual Studio, please go to the directory D: \ VS2008 \ akbarSolution1 \ akbarWeb1. You will see several files created automatically by Visual Studio, one of which is Default.aspx which will be our focus next.
Default.aspx:
1. Provide basic example web application creation using ASP.NET and C #.
2. Knowing the form of programming web applications using ASP.NET and C #.
3. Introducing the use of some ASP.NET controls like TextBox, Button, and Label.
4. Introducing the C # programming related processing the sentence (string)
Preparation
The first step we will do is create a Web Project. We start this first exercise by opening the Visual Studio. After Visual Studio is opened, follow these steps:
1. Select File menu
2. Select New Project menu, then Visual Studio will bring up the New Project dialog
3. In the Project Type, select Visual C #. This will result in changes to the existing list of items in the template.
4. In the section Templates, select ASP.NET Web Application.
5. In the Name, write PoertyWeb1, this is the name that we created a web project.
6. In the Location section, select the location where to store our project file. I recommend to create
their own project file storage location for example that I created in D: \ VS2008.
7. In the Solution Name field, automatically, Solution name will be tailored to our project web
name is akbarWeb1. Change the name into akbarSolution1.
8. In the Create directory for solution, make sure the checkbox is already checked.
9. Click the OK button. So the first web project we are ready for our program
and Default.aspx file will automatically be opened for us to start working.
To understand the structure of the project file created by Visual Studio, please go to the directory D: \ VS2008 \ akbarSolution1 \ akbarWeb1. You will see several files created automatically by Visual Studio, one of which is Default.aspx which will be our focus next.
Design, Coding, Compiling
Now we can start doing web page design and programming. For information, each ASP.NET page will always be terminated by the extension. aspx. Now we note the Default.aspx page that was opened in ototmatis by Visual Studio. Make sure that the display Default.aspx is in Source mode. If not, find the Source button at the bottom left window of Visual Studio. For information, there are 3 (three) types of ASP.NET pages that display mode Design, Split, and Source. We will discuss in more detail in another article. In Source mode, which we see is the HTML tags from our ASP.NET pages. I personally prefer the Source mode because it is lighter, simpler, and can make changes to ASP.NET tags or HTML directly. Now, adjust the code in your Default.aspx page with the following code:Default.aspx:
<form runat="server">
<div>
<asp:Label runat="server"></asp:Label><br />
<asp:TextBox runat="server"></asp:TextBox>
<asp:Button runat="server" Text="Submit"
onclick="btnSubmit_Click" />
</div>
</form>
to be continued next week......
1 komentar:
bravo asp.net....
Posting Komentar