在buttn click事件的弹出窗口中显示.aspx页面 [英] Displaying a .aspx page in a pop up window on buttn click event

查看:97
本文介绍了在buttn click事件的弹出窗口中显示.aspx页面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在按钮点击事件的弹出窗口中显示.aspx页面。我可以在弹出窗口中显示图像,但是如何显示服务器端页面,如.aspx。

I want to show a .aspx page in a pop up window on button click event . I am able to display images in pop up window but how to display a server side page like .aspx.

推荐答案

首先,请亲吻使用的想法用于执行此操作的任何默认或内置弹出窗口,例如警报对话框等。



如果要显示弹出窗口,使用简单的HTML容器元素创建一个,这是一个简单的 div 元素。现在,加载该页面的代码非常简单,您可以使用简单的Ajax请求来请求数据。你不关心这里的任何C#代码,你只想在这里渲染HTML文档。所以,创建一个这样的HTML网页(我将仅为弹出窗口编写代码),



First of all, please kiss away the thought of using any of the default or built-in pop up windows for doing this, such as alert dialog boxes etc.

If you want to show a pop-up window, you create one using a simple HTML container element, which is a simple div element. Now, the code to load that page is pretty much simple, you would use a simple Ajax request to request for the data. You're not concerned with any of the C# code here, you just want to render the HTML document here. So, create a HTML web-page as this one (I am going to write the code for pop-up window only),

<div class="pop-up" style="display: none;">
   <!-- Leave it empty -->
</div>





..你可以添加其他样式,使其漂浮在其他元素上。现在,编写JavaScript代码以创建新的Ajax请求并调用数据。像这样,





.. you can add other styles to make it float over other elements too. Now, write the JavaScript code to create a new Ajax request and call for data. Like this,

// I will use jQuery here..


document )。ready( function (){
// 在这里创建请求,
(document).ready(function () { // create the request here,


.ajax({
url:' link-页面下载'
成功:功能(数据){
/ * 成功后,
*可能会传递整个HTML,
*不用担心任何返回语句,文件将在这里发送
*到数据变量..
* /
.ajax({ url: 'link-of-page-to-download', success: function (data) { /* upon success, * chances are that entire HTML will be passed down, * do not worry about any return statements, the document will be sent * down into the data variable here.. */


这篇关于在buttn click事件的弹出窗口中显示.aspx页面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆