As a rule, the answer to your question is no.
However, in some cases, it may be possible to display part of the ASP.net page and then place the result on the ASP page.
I experimented with this a bit last week using AJAX.
Here is what you can do.
Suppose you have an ASP.net page with the form that you want to display on the ASP page.
1) Create an ASP.net page with the form and wrap it in ASP: Panel - give it an identifier: pnlForm 2) In the ASP.net code, enter the following code in Page_Load : pnlForm.RenderControl() .
System.IO.StringWriter stringWriter = new System.IO.StringWriter(); HtmlTextWriter htmlWriter = new HtmlTextWriter(stringWriter); pnlReport.RenderControl(htmlWriter); Response.Write(stringWriter.ToString());
3) Add the following code snippet to the end of the code:
4) Create an empty div on your classic ASP page - give it the identifier formDiv .
5) On the classic ASP page, use jQuery.ajax to retrieve the form and place it on the classic ASP page:
$.ajax({ type: "GET", url: "myASPdotNetpage.aspx", success: function(response) { $('#formDiv').html(response); } });
As you can imagine, this is not exactly how the framework is supposed to be used, but if you really need to display some ASP.net and put it somewhere else (for example, on an ASP page or even a spreadsheet), you can at least grab HTML.
Daniel Allen Langdon
source share