Requsting another page.

L

Lucky

Hi guys,

i'm stuck in very odd situation here, the problem is i need to ask one
aspx page to give me data from another aspx page. the flow in like
this:

Page1_load()
{
string value=requstPage2();
processvalue(value);

displayValue();

}

here the Page2 is one aspx page that returns xml data. that i need to
catch in the page1's load event and after processing it i need to
display the value.

honestly i dont know how to do this. how to requset another page from
the page without moving to page2 and get the xml data generated by the
page2 and process it.

can anyone tell me how can i requset page2 without leaving page1?

i would appriciate any help.

thanks,
Lucky
 
R

Ralph

You could use server.execute, store your xml in the session or app object
and stuff it into value, as execute doesn't return a value......or simply do
a get request using the net classes.

--
--
Regards

John Timney (MVP)http://www.johntimney.comhttp://www.johntimney.com/blog












- Show quoted text -

I tend to find that when I just use server.execute that I get page I
executed appearing back in the page I called Server.execute from.
If I just want a page to run and don't want the output I will over
ride the render
protected override void Render(HtmlTextWriter writer)
I had a case where I wanted to email a page, but not see it on the
screen.


However if I need the data from the page I will do something similar
to the following
StringBuilder sb = new StringBuilder();
StringWriter stw = new StringWriter(sb);
Server.Execute("TestPage.aspx",stw);
sb now has the data from TestPage.aspx
 

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,780
Messages
2,569,611
Members
45,269
Latest member
vinaykumar_nevatia23

Latest Threads

Top