Create An Aspnet Web Page

You can create an ASP.NET Web Form that provides the HTML to render the user interface and processes requests from a user. You can do this by having the page submit to itself. To start the ASP.NET page, declare what language you will use on the page. Then add the standard HTML to the page, including the <html> and the <body> tags.

When you are ready to create the form for the page, you need to use the correct tags to do this. However, with ASP.NET, you must set up both the form and the controls on the form to run server-side. You can do this by setting the runat attribute equal to Server. For more information about server-side controls, see Chapter 5, Introduction to Server-side Controls.

With ASP.NET Framework, the model for processing and responding to user requests is to use the same Web file(s) for collecting user input and displaying results. This model could be implemented with ASP 3.0, but you would typically see a separate page for collecting input and displaying results of submitted input. This model of sending requests to the same page that collects user input is called postback. Postbacks are an integral part of the event-handling model that is available in ASP.NET Web Forms.

% Untitled - Notepad

File I Edit Format Help New Ctrl+N

I Open...

Ctrl+O

Save

Ctrl+5

5ave As.,.

CREATE AN ASP.NET WEB PAGE

% Untitled - Notepad

File I Edit Format Help New Ctrl+N

Page

JLlJil

Files of type: (All Files

Code Templates i Ètfi-

BusinessTitlesTemplate.aspx CommentsT emplate. aspx Con vertT oWebPageT emplate.aspx CreateApplicationTemplate.as| x CreateCookieCollectionT empla CieateCookieTemplate. asp h Creates essionT emplate. aspx D atagridT emplate. aspx I DeclareS erverSideDbjectGlob I' I DefaultTemplate.htm D eleteApplicationT emplate. as[ x

Files of type: (All Files

□ Start your text editor.

-0 Click File O Open.

[1] D eleteS essionT emplate. aspx

1 Gener cT emplate. asp

I Gener cT emplate. aspx |

G enericT emplate. htm G etRequestParamsT emplate. aspx R eadApplicationT emplate. aspx R eadCookieCollectionT emplate. aspx R eadCookieT emplate. aspx R eadS essionT emplate. aspx S uggestionsT emplate. htm S uggestionsT emplatel .aspx jJ

Cancel zi

Q Click 0 to select All Files from the drop-down list.

Click to select a template.

Cancel zi

-Q Type a description of the page between the <H3> tags.

^0 Click between the <BODY> tags and create a form for collecting information about user comments.

I Add additional HTML controls to the form to collect information.

Add a Submit button to the form.

Was this article helpful?

0 0

Post a comment