你能渲染一个ASP吗?Net控件在非ASP中。网通过AJAX页面

时间:2022-03-05 04:45:09

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

我们有一个用经典ASP编写的旧页面,它通过原型库的Updater对象调用现有的. ASP页面。

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.

这个调用在w/ the请求中传递了一些查询字符串参数,并接收了要更新的params列表,以及要在主asp页面上呈现的HTML/JS块。

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?

我想澄清/简化最初的问题:是否有一种呈现ASP的方法。网络控制。ascx或服务器控件)在非ASP.net页面?

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.

理想情况下,它将通过AJAX调用,并返回一个HTML文本块——以及一些将状态转移到接收页面的方法。

3 个解决方案

#1


2  

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.

您可以将控件放置在一个web服务中,该web服务返回原始HTML作为输出,并调用来自AJAX的web服务,使用动态HTML将结果放置在您想要的任何位置。您可能需要使用控件的输出缓冲区来让它按照您希望的方式工作。

#2


1  

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?

您可以将一个IFRAME放入包含aspx页面的asp中,并使用某种机制传递参数,可能是通过一个QueryString值?

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?

asp页面可以将一个条目(params)写入到一个表中,创建一个ID (Guid),并将其传递到aspx页面,从而重新生成条目?

#3


1  

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.

假设您的web服务器可以在目标框架上运行.aspx文件,那么是的,您可以将控件/页面的结果呈现为一个经典的asp页面,或者一个普通的旧html页面。您不能提供任何服务器端功能,因此您只能呈现控件/页面生成的html结果。

#1


2  

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.

您可以将控件放置在一个web服务中,该web服务返回原始HTML作为输出,并调用来自AJAX的web服务,使用动态HTML将结果放置在您想要的任何位置。您可能需要使用控件的输出缓冲区来让它按照您希望的方式工作。

#2


1  

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?

您可以将一个IFRAME放入包含aspx页面的asp中,并使用某种机制传递参数,可能是通过一个QueryString值?

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?

asp页面可以将一个条目(params)写入到一个表中,创建一个ID (Guid),并将其传递到aspx页面,从而重新生成条目?

#3


1  

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.

假设您的web服务器可以在目标框架上运行.aspx文件,那么是的,您可以将控件/页面的结果呈现为一个经典的asp页面,或者一个普通的旧html页面。您不能提供任何服务器端功能,因此您只能呈现控件/页面生成的html结果。