New Web SiteFile New Web SiteASP.NET Web SiteVisual C#language.

baasopchoppyΑσφάλεια

5 Νοε 2013 (πριν από 4 χρόνια και 8 μέρες)

119 εμφανίσεις

ASP.NET Tutorial

STEP 1. Open Visual Studio


STEP 2. You can create a new Web Site by selecting
New Web Site

from the
File
menu.
In
New Web Site

dialog box, you select
ASP.NET Web Site

for the template and
Visual C#

for
language.



You will see a blank
De
sign

page like this:



STEP 3. In the blank page, type “Enter Name: ” and drag and drop a TextBox from
ToolBox:



In the properties bar, set the TextBox’s
ID

to “nameTextBox”.


STEP 4. By using drag and drop, insert a
Label

and a
Button
below. Modify the

ID
proprety of label to “nameLabel” and Text property to blank. Change the ID property of
button to submitButton and Text property to Submit, too.



STEP 5. Double click on the
Submit

button to go to the Code Editor. Add the following
code in the submitB
utton_Click event handler.



nameLabel.Text =
"Hello "

+ nameTextBox.Text;




STEP 6. Run the Web Application

Build and Run the program, and you should see:



The Microsoft Visual Studio can launch a web server by itself for testing progra
m, you
can also deploy this application to other server, IIS etc.