Web Development Basics

Exlr fH The Web Forms architecture gives you the ability to run server-side code when client-side events are fired. This is how you can run C# code when the button is clicked. The Web Forms framework handles virtually all of the mechanics of capturing, transmitting, and interpreting the event and handling it appropriately on the server.

Instead of responding to events on the server, you can write client-side script that handles events on your Web page. These scripts are interpreted by the client's browser. Because users can have one of many browsers, you are not assured that the event-handling code will run properly. Also you are not assured that the user will access your page with a browser that can interpret script. There are programmatic ways to address these issues, but you will find that server-side code is a more reliable way to process events.

^ CommentsTemplate.aspx - Notepad

| File | Edit Format Help

New

Ctrl+N

Open.,,

Ctrl+O

5ave

Ctrl+S

Page Setup.

Print,.,

Exit

IKf

E Type

SubmitReceiveComments.aspx as your filename.

E 3 Click the Send Comments button.

Click File O Save As.

m Click to select the Default Web Site folder where you want to store your file.

-■ If the Default Web Site folder is not onscreen, click the Save in 0 to select the folder.

E Type

SubmitReceiveComments.aspx as your filename.

le Click Save to save and close the dialog box.

m Browse to the saved Web page at http://localhost /SubmitReceive Comments.aspx.

le Type your information into the fields on the form.

E 3 Click the Send Comments button.

-■ The Web page echoes back the information that you filled in on the form.

Was this article helpful?

0 0

Post a comment