Creating a Web Form with some basic content using ASP.NET in C# - Lesson 2

Start Visual Studio 2010
On the main menu choose File, New, Web Site




In the dialog which is appeared make the selections that is mentioned in red rectangles schemas bellow
 On the solution explorer window, press right click on C:\...\Lesson02\ element. A new menu appeared. On this menu choose New Item.











A new window is appeared. Choose the selection Web Form and you should give a name for it. In this example I am giving the name myForm.aspx. When you are ready press Add Button.























This action creates a new form in our project and a new window like this bellow is appeared. At the left and down corner there are three different choices: Design, Spit and Source. While you press any of this buttons the view will be changed. The Design button is helping to previewing the form. The Source button is giving access to code and the Spilt button is helping us to have access on both previous views


 So, press the Design button to switch to the Design view


Click inside the dashed area until you see the label div instead  the label body


















Type Welcome to my web site visitor and then press the button Source


















In the new view locate the sentence you just have typed and add the tags

before the sentence and

after. Then press the button Design

In the new view you can see the reaction of the tag

... (which means heading)



















Position the cursor at the end of the sentence you have wrote and press the Enter form your keyboard.
A new paragraph is inserted indicated by the symblol p


















Type the text sown in the below picture. Have in mind that when you press Enter form your keybord you can start a new parapraph.



















We can also make a lot of formats on our text, such as to change the foreground color, or make some text bold or Italics, or we can also change the color of the backgroud. It's up to us.



























Now press the button Source. The code should look more or less similar to the code in picture below



















Press Ctrl + F5 to execute the project into your browser.

Type into textbox area your message and then press the button.

Good luck.....

Antonis

Δεν υπάρχουν σχόλια: