P. 1
ASP Net

ASP Net

5.0

|Views: 2,821|Likes:
Published by Abdulraheman

More info:

Published by: Abdulraheman on Jun 04, 2009
Copyright:Attribution Non-commercial

Availability:

Read on Scribd mobile: iPhone, iPad and Android.
download as PDF, TXT or read online from Scribd
See more
See less

12/16/2012

pdf

text

original

196

ASP.NET

DISPLAY DATA WITH REQUEST.PARAMS

103617-6 Ch09.F 9/26/01 9:44 AM Page 196

197

USING ASP.NET COMPONENTS 9

· Add the GetRequestParams
function and code from the file

GetRequestParams.aspx

located in the Code Templates
directory.

‚ Save the file and request it
from the Web server.

— Request the first Web page
that you created in this task.

± Click and select a
suggestion.

¡ Click the Submit button.

I Request data displays
from looping through the

Request.Params

collection.

You can just display the formvariables using the following code:

Example:

<% GetRequestForm(); %>

103617-6 Ch09.F 9/26/01 9:44 AM Page 197

⁄ Open the

GenericTemplate.aspx

template from the Code
Templates directory.

¤ Add a heading for
the page.

‹ Add a message to
the user.

› Add a form to the page.

ˇ Place a drop-down list box
on the page with suggestions
for choosing the suggested
number of goals.

Á Add a button control to
the page.

You can use the HTTPResponseclass to interact

with the responses given to Web requests.One
common task for the HTTPResponseis to write
custom HTML in the response to a user’s page
request.Writing custom HTML can be accomplished
with the Writemethod of the Responseobject.
Note that the methods and properties of the
HTTPResponseclass are exposed through ASP.NET’s
intrinsic Responseobject.

To get user input to display in a new HTML element,
you can programmatically add HTML elements/
tags with Response.Write.When using the

Response.Writeto customize the HTML markup
of a page,you need to know where you want to have
the tag(s) placed.You can place in a placeholder tag
in which you can insert HTML SPAN or DIV tags),or
you can use the script delimiters inline to the HTML.

If you are posting a page back to itself,you can check
the IsPostBackproperty of the page to determine
if it is the first time you are displaying the page or if
you have posted back to the same page.In some
cases,you will only want to run certain server-side
code after a page is posted back to itself.

You're Reading a Free Preview

Download
scribd
/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->