![]() |
|
|
|||||||
![]() |
ASP Net - Rendering an instance of an .aspx page |
|
|
Thread Tools | Search this Thread |
|
|
#1 |
|
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. foobar |
|
|
|
|
#2 |
|
Posts: 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" <> wrote in message news:%23J3ONUX$... > 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. > > Eliyahu Goldin |
|
|
|
#3 |
|
Posts: 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" <> wrote in message news:%23cbcRcX$... > 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" <> wrote in message > news:%23J3ONUX$... > > 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. > > > > > > foobar |
|
|
|
#4 |
|
Posts: 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. > Matt Berther |
|
![]() |
| Thread Tools | Search this Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| sessions in .aspx getting mixed up. | jet vedi | Software | 0 | 07-23-2009 07:25 PM |
| Load .aspx page on another frame from TreeView Event | Sangeeth | Software | 0 | 06-25-2009 09:20 AM |
| .aspx page apears minimized when pops up | sam.dev | Software | 3 | 02-04-2008 03:04 PM |
| master page & app_theme folder doesn't work | dummies2 | General Help Related Topics | 0 | 09-04-2007 05:41 PM |
| Clear the Session value on page unload | tessythampan | Software | 1 | 08-12-2006 12:18 PM |