views:

137

answers:

3

We have an old page written in Classic ASP that makes calls to an existing .asp page through the Prototype library's Updater object.

This call passed some query string parameters in w/ the request and received a list of params to update as well as a block of HTML/JS to render onto the main asp page.

It seems that the page lifecycle complicates things, but implementing in an actual server control or usercontrol could work.

[EDIT] I'd like to clarify/simplify the original question: Is there a way to render an ASP.NET control (.ascx or server control) in a non ASP.net page?

Ideally it would be called via AJAX and return a block of HTML Text - along with some way to transfer state to the receiving page.

+1  A: 

You could put an IFRAME into the asp that contains the aspx page and use some mechanism to pass through parameters, possibly through a QueryString Value?

The asp page could write an entry(params) into a Table, creating an ID (Guid) thats passed through to the aspx page which retreives the entry?

Mark Redman
I'd like to avoid the IFRAME if possible, but are there any common techniques for returning values from an IFRAME?
jkelley
I am not sure, but it may be possible to communicate through javascript?Does the system make it possible to re-implement that asp in .net? (Am sure you've asked yourself that)
Mark Redman
yes, the system does make it possible, though we're trying to avoid it b/c much of the remainder of the site mucks around with ASP sessions. It may be that the best approach is to share session state by passing the GUID around. I still believe there must be a way to render an asp.net control in a non-asp.net page. I'll clarify the question and hope.
jkelley
+2  A: 

You could place the control in a web service that returns the raw HTML as output and call the web service from AJAX placing the results wherever you wanted using dynamic HTML. You might have to play around with the output buffer of the control to get this to work the way you want it though.

pdavis
I think this is probably the best shot we have...I'll give this a go along with using the database to persist any pesky state info we need.
jkelley
+1  A: 

Assuming your webserver can run .aspx files on the target framework, then yes, you can render the RESULTS of the control / page into a classic asp page, or a plain old html page for that matter. You can't have any server-side functionality present, so you'd just be rendering the html generated results of the control/page.

ScottE