Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Render to memory stream 1

Status
Not open for further replies.

Gorkem

Programmer
Jun 18, 2002
259
CA
Hi there,

What I have here is somewhat of a complicated case. I need to be able to load an ASPX page which will in turn load a 2nd ASPX page in from a file and render the results of the 2nd ASPX into memory. I am sort of unsure how to about this.

Essentially, I can have my code behind load up this file using regular IO, but how do I render the code so that the datalist's are populated?

Any help would be appreciated.

Thanks,

G.



Oxigen - Next generation business solutions
-----------------------------
Components/Tools/Forums/Software/Web Services
 
You could use the httpWebRequest and httpWebResponse methods to get the resulting markup from the second page. You can then render them as necessary, however, you may have a problem once you come to maintaining their state or accessing values.


____________________________________________________________

Need help finding an answer?

Try the Search Facility or read FAQ222-2244 on how to get better results.

 
I was thinking that, but then I realized it wouldn't work as there are session variables that need to be processed into the file. By doing an HttpWebRequest, it would essentially start a new session for that one request.

Cheers,

G.

Oxigen - Next generation business solutions
-----------------------------
Components/Tools/Forums/Software/Web Services
 
Why does the second aspx page need to be "in memory" and waht do you need to do to it?


____________________________________________________________

Need help finding an answer?

Try the Search Facility or read FAQ222-2244 on how to get better results.

 
Ok.. so I think I've found a way around it to a certain extent.. however I am still having problems.

I put a panel control on the page, and created a custom user control with the secondary page I want to process into memory. When the PageLoad event fires, I RenderControl to a string and hide the panel control.

This method "SORT OF" works, where the control is rendering, however it does not pull the information for my datalists. Any suggestions?

Cheers,

G.



Oxigen - Next generation business solutions
-----------------------------
Components/Tools/Forums/Software/Web Services
 
Well basically, I'm trying to render the 2nd aspx into memory so that I can email the results. Basically the 2nd aspx is acting as a template file, and once rendered, I want to take the resulting HTML and email it to a specific person.



Oxigen - Next generation business solutions
-----------------------------
Components/Tools/Forums/Software/Web Services
 
Maybe you could have the 2nd page accept the parameters a different way? If you created a httpWebRequest and called the 2nd page but passed the variables through as a querystring rather than a session variable, it could then use those variables to render the correct page. The resulting markup of this request could then be used in your email.


____________________________________________________________

Need help finding an answer?

Try the Search Facility or read FAQ222-2244 on how to get better results.

 
I wish it were that easy, unfortunately, there is too much information to pass in a query string..

But surely there must be an equivilent version of ASP's Server.Execute() for ASP.NET, which I could use to render an ASPX into a string.

Cheers,

G.

Oxigen - Next generation business solutions
-----------------------------
Components/Tools/Forums/Software/Web Services
 
The Server.Execute method still exists as part of the .NET framework


____________________________________________________________

Need help finding an answer?

Try the Search Facility or read FAQ222-2244 on how to get better results.

 
Oh.. well then there's the problem.. Let this be a lesson learned.. Don't over complicate a simple problem.

Thanks!!

G.


Oxigen - Next generation business solutions
-----------------------------
Components/Tools/Forums/Software/Web Services
 
Yes, I must admit I didn't think of that method until you suggested it and then it seemed so simple!


____________________________________________________________

Need help finding an answer?

Try the Search Facility or read FAQ222-2244 on how to get better results.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top