HttpWebRequest

A

Amy

I need to pass a user id from page1.aspx to page2.asp
when the user hits page1.aspx page.

page2.asp will return an xml document containing
additional user information which will be displayed in
page1.aspx

Can I post data to page2.asp using HttpWebRequest or is
there another way to do this?
 
P

Peter Rilling

How are you navigating to page 2. HttpWebRequest is for when the software
wants to download the page, but it the user is interacting with page 2, then
you probably will not use the WebRequest. You can always pass that
information in the querystring or a session variable.
 
W

William F. Robertson, Jr.

You might want to look at Server.Execute. You can pass the method a
TextWriter that will return the response. (your xml)

You can then use this xml however you want.

bill
 
M

MWells

A querystring param is probably simplest, e.g.

/page2.aspx?UserID=23

It's easy for your receiving page to acquire and work with the value, and
easy for your sending page to compose into the Url.

The process of how you request the XML and embed it into Page1 depends
partly on what you're doing with it, but I seem to recall that the in-built
Xml webcontrol can retrieve Xml from a url source.

/// M
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,067
Latest member
HunterTere

Latest Threads

Top