473,491 Members | 1,917 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Capturing ASPX output from another page

I often have the need to run templates that perform the equivalent of a mail
merge as part of the processing for another page. For example, I have an
invoice display page in my admin module and hten need to send a prepared
message (such as a declined order email) to the invoicee, which consists of
a merge letter.

Server.Transfer() doesn't do the trick, as it leaves the current page and
doesn't return. I could do this but this is quite a hassle to do as you have
to pass state back and forth across pages.

I know I can capture output from the current page by overriding the Render()
method of the page and that works for many things as long as the content to
merge is the same as the current page (works well for things like Invoice
Confirmations)... but is there anyway to cause another page to be
instantiated and be rendered via code (ie. without calling the ASPX file??
I've tried to do this by instantiating the class, but it would seem that the
HTTP runtime needs to know more info in order to render or even fire the
code in the form...

Any ideas on how to accomplish this?
+++ Rick ---
--

Rick Strahl
West Wind Technologies
http://www.west-wind.com/
http://www.west-wind.com/wwHelp
----------------------------------
Making waves on the Web


Nov 17 '05 #1
1 2969
You can use the WebRequest object to call your web page, then you can
capture the HTML that it output.

Here's a nice example:
http://www.digitalvideotoolbox.com/M...on.aspx?QID=88

--
I hope this helps,
Steve C. Orr, MCSD
http://Steve.Orr.net
"Rick Strahl [MVP]" <ri********@hotmail.com> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
I often have the need to run templates that perform the equivalent of a mail merge as part of the processing for another page. For example, I have an
invoice display page in my admin module and hten need to send a prepared
message (such as a declined order email) to the invoicee, which consists of a merge letter.

Server.Transfer() doesn't do the trick, as it leaves the current page and
doesn't return. I could do this but this is quite a hassle to do as you have to pass state back and forth across pages.

I know I can capture output from the current page by overriding the Render() method of the page and that works for many things as long as the content to merge is the same as the current page (works well for things like Invoice
Confirmations)... but is there anyway to cause another page to be
instantiated and be rendered via code (ie. without calling the ASPX file??
I've tried to do this by instantiating the class, but it would seem that the HTTP runtime needs to know more info in order to render or even fire the
code in the form...

Any ideas on how to accomplish this?
+++ Rick ---
--

Rick Strahl
West Wind Technologies
http://www.west-wind.com/
http://www.west-wind.com/wwHelp
----------------------------------
Making waves on the Web

Nov 17 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
1952
by: jerrygarciuh | last post by:
Hello, I have a client who has decided to output the OO PHP/mySQL site I have made for them onto a cd. I realize that $html = include('somefile.php'); gets 1 for success as its return value....
5
1621
by: Mike | last post by:
I'm trying to capture data that is created by launching a php file, for example the last 10 posts in a message forum. If last10.php is called directly in your browser you'll see hyperlinks to the...
1
5347
by: Oz | last post by:
This is long. Bear with me, as I will really go through all the convoluted stuff that shows there is a problem with streams (at least when used to redirect stdout). The basic idea is that my...
9
2213
by: Steve Peterson | last post by:
Hi I have an .aspx web form in which I would like to output only XML, no HTML. The datasource is a datatable that's bult on the fly based on user input from previous .aspx page so the XML output...
10
5995
by: Andrew | last post by:
Hi, I have a messagebox that pops up due to an event. I did it in javascript. ie. alert("Time's up. Assessment Ended"); I want to capture the OK and Cancel events of this alert messagebox. My...
2
1706
by: Ken Cox - Microsoft MVP | last post by:
I'm trying to find a way to program in ASP.NET 2.0 but capture the HTML output. I found the following routine in ASP.NET 2.0 Cookbook from O'Reilly. It doesn't work if I include a server-side...
6
2249
by: Ed Leafe | last post by:
I've been approached by a local business that has been advised that they need to start capturing and archiving their instant messaging in order to comply with Sarbanes-Oxley. The company is largely...
12
4744
by: =?Utf-8?B?RnJlZU5FYXN5?= | last post by:
Hello, the scenario: There's an ASPX page which shows some text and has three buttons at the bottom: Save, Print and Close. Print and close is done by javascript. But how can I save the page...
0
1591
by: Buglish | last post by:
Hi, Task : -Capture a HTML table with use of regular expression from a text string buffer(entire document). –Pass it to another function to create a multi dimension array out of it. - Pass it...
0
6980
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7157
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7192
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6862
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5452
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
4886
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3087
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1397
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
282
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.