By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,985 Members | 2,907 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,985 IT Pros & Developers. It's quick & easy.

Rendering an instance of an .aspx page

P: n/a
Okay, if I create an instance of an .aspx page and set the properties of
that page, how do I render that instance?
Server.Transfer creates a new instance of its own and none of the properties
have been set.

p.s. I thank you in advance for any relpy.
Nov 19 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
Are you sure you are on the right track? Normally you would have a page as a
file and set the properties when the page loads.

Eliyahu

"foobar" <es***@inbizservices.com> wrote in message
news:%2****************@TK2MSFTNGP15.phx.gbl...
Okay, if I create an instance of an .aspx page and set the properties of
that page, how do I render that instance?
Server.Transfer creates a new instance of its own and none of the properties have been set.

p.s. I thank you in advance for any relpy.

Nov 19 '05 #2

P: n/a
I have created a class that takes some connection parameters and a crystal
report file name. When initialized the connection data is setup on the
instance. I have added a method whereby Crystal Parameter fields can be
added.
I am trying to create a model whereby I can configure any given report and
render this report in a generic aspx page. I could then set the Report
property on this generic aspx page to that created in the class metioned
above. Set whether I want to preview in browser or export to file and then
render the aspx page.
I could be going about this all wrong. Please advise.

"Eliyahu Goldin" <re*************@monarchmed.com> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
Are you sure you are on the right track? Normally you would have a page as a file and set the properties when the page loads.

Eliyahu

"foobar" <es***@inbizservices.com> wrote in message
news:%2****************@TK2MSFTNGP15.phx.gbl...
Okay, if I create an instance of an .aspx page and set the properties of
that page, how do I render that instance?
Server.Transfer creates a new instance of its own and none of the

properties
have been set.

p.s. I thank you in advance for any relpy.


Nov 19 '05 #3

P: n/a
Hello foobar,

Use the RenderControl method of the Page and pass in an HtmlTextWriter.

StringBuilder sb = new StringBuilder();
using (StringWriter sw = new StringWriter(sb))
using (Html32TextWriter writer = new Html32TextxWriter(sw))
{
myPageVariable.RenderControl(writer);
}

// at this point, sb.ToString() has the rendered instance of the Page

--
Matt Berther
http://www.mattberther.com
Okay, if I create an instance of an .aspx page and set the properties
of
that page, how do I render that instance?
Server.Transfer creates a new instance of its own and none of the
properties
have been set.
p.s. I thank you in advance for any relpy.

Nov 19 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.