怎么让网页弹出一个aspx网页?

lxbgg 2012-09-18 08:14:32

上面的弹出层是用js写的,我想用aspx网页的形式弹出,而且不是以新页面的形式弹出,不知道怎么做,有没有做过的朋友提供点思路,怎么控制网页的宽度呢?有例子最好
...全文
418 13 打赏 收藏 转发到动态 举报
写回复
用AI写文章
13 条回复
切换为时间正序
请发表友善的回复…
发表回复
rayyu1989 2012-09-19
  • 打赏
  • 举报
回复
iframe + 浮动 +剧中定位 + 遮罩层
极地_雪狼 2012-09-19
  • 打赏
  • 举报
回复
楼上,他不想弹出新窗口。
AJAX
或者你在div内放一个iframe
o0_真诚_0o 2012-09-19
  • 打赏
  • 举报
回复
thickbox_plus.js

$(document).ready(TB_launch);

// function for adding Thickbox to elements of class .thickbox
// wrapped by Christian Montoya for uses other than $(document).ready
function TB_launch() {
$("a.thickbox").click(function(){
var t = this.title;
TB_show(t,this.href);
this.blur();
return false;
});
}

function TB_show(caption, url) { //function called when the user clicks on a thickbox link
try {
$("body")
.append("<div id='TB_overlay'></div><div id='TB_window'></div>");
$("#TB_overlay").css("opacity","0.6");
$("#TB_overlay").css("filter","alpha(opacity=60)");
$("#TB_overlay").css("-moz-opacity","0.6");
$(window).resize(TB_position);
$("body").append("<div id='TB_load'><div id='TB_loadContent'><img src='images/circle_animation.gif' /></div></div>");
$("#TB_overlay").show();
var urlString = /.jpg|.jpeg|.png|.gif|.html|.htm/g;
var urlType = url.match(urlString);

if(urlType == '.jpg' || urlType == '.jpeg' || urlType == '.png' || urlType == '.gif'){//code to show images

var imgPreloader = new Image();
imgPreloader.onload = function(){

// Resizing large images added by Christian Montoya
var de = document.documentElement;
var x = (self.innerWidth || (de&&de.clientWidth) || document.body.clientWidth) - 50;
var y = (self.innerHeight || (de&&de.clientHeight) || document.body.clientHeight) - 80;
if(imgPreloader.width > x) {
imgPreloader.height = imgPreloader.height * (x/imgPreloader.width);
imgPreloader.width = x;
if(imgPreloader.height > y) {
imgPreloader.width = imgPreloader.width * (y/imgPreloader.height);
imgPreloader.height = y;
}
}
else if(imgPreloader.height > y) {
imgPreloader.width = imgPreloader.width * (y/imgPreloader.height);
imgPreloader.height = y;
if(imgPreloader.width > x) {
imgPreloader.height = imgPreloader.height * (x/imgPreloader.width);
imgPreloader.width = x;
}
}
// End Resizing

TB_WIDTH = imgPreloader.width + 30;
TB_HEIGHT = imgPreloader.height + 60;
$("#TB_window").append("<img id='TB_Image' src='"+url+"' width='"+imgPreloader.width+"' height='"+imgPreloader.height+"' alt='"+caption+"'/>"+ "<div id='TB_caption'>"+caption+"</div><div id='TB_closeWindow'><a href='#' id='TB_closeWindowButton'>关闭</a></div>");
$("#TB_closeWindowButton").click(TB_remove);
$("#TB_Image").click(TB_remove); // close when image clicked added by Christian Montoya
TB_position();
$("#TB_load").remove();
$("#TB_window").slideDown("normal");
}

imgPreloader.src = url;
}

if(urlType == '.htm' || urlType == '.html'){//code to show html pages

var queryString = url.replace(/^[^\?]+\??/,'');
var params = parseQuery( queryString );

TB_WIDTH = (params['width']*1) + 30;
TB_HEIGHT = (params['height']*1) + 40;
ajaxContentW = TB_WIDTH - 30;
ajaxContentH = TB_HEIGHT - 45;
$("#TB_window").append("<div id='TB_closeAjaxWindow'><a href='#' id='TB_closeWindowButton'>关闭</a></div><div id='TB_ajaxContent' style='width:"+ajaxContentW+"px;height:"+ajaxContentH+"px;'></div>");
$("#TB_closeWindowButton").click(TB_remove);
$("#TB_ajaxContent").load(url, function(){
TB_position();
$("#TB_load").remove();
$("#TB_window").slideDown("normal");
});
}

} catch(e) {
alert( e );
}
}

//helper functions below

function TB_remove() {
// #TB_load removal added by Christian Montoya; solves bug when overlay is closed before image loads
$("#TB_window").fadeOut("fast",function(){$('#TB_window,#TB_overlay,#TB_load').remove();});
return false;
}

function TB_position() {
var de = document.documentElement;
var w = self.innerWidth || (de&&de.clientWidth) || document.body.clientWidth;
var h = self.innerHeight || (de&&de.clientHeight) || document.body.clientHeight;

if (window.innerHeight && window.scrollMaxY) {
yScroll = window.innerHeight + window.scrollMaxY;
} else if (document.body.scrollHeight > document.body.offsetHeight){ // all but Explorer Mac
yScroll = document.body.scrollHeight;
} else { // Explorer Mac...would also work in Explorer 6 Strict, Mozilla and Safari
yScroll = document.body.offsetHeight;
}

$("#TB_window").css({width:TB_WIDTH+"px",height:TB_HEIGHT+"px",
left: ((w - TB_WIDTH)/2)+"px", top: ((h - TB_HEIGHT)/2)+"px" });
$("#TB_overlay").css("height",yScroll +"px");
}

function parseQuery ( query ) {
var Params = new Object ();
if ( ! query ) return Params; // return empty object
var Pairs = query.split(/[;&]/);
for ( var i = 0; i < Pairs.length; i++ ) {
var KeyVal = Pairs[i].split('=');
if ( ! KeyVal || KeyVal.length != 2 ) continue;
var key = unescape( KeyVal[0] );
var val = unescape( KeyVal[1] );
val = val.replace(/\+/g, ' ');
Params[key] = val;
}
return Params;
}
o0_真诚_0o 2012-09-19
  • 打赏
  • 举报
回复
页面一

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<script type="text/javascript" src="js/jquery.js"></script>
<script type="text/javascript" src="js/thickbox_plus.js"></script>
<link rel="stylesheet" type="text/css" href="css/thickbox.css"/>
</head>
<body>
<a href="ShowLogin.html?height=160;width=400" title="应聘该职位并投递简历" class="thickbox" >马上应聘该职位</a>
</body>
</html>


弹出页面

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
</head>
<style type="text/css">
*{margin:0px;border:0px;padding:0px;}
body{font:12px "宋体";}
a{color:#000;text-decoration:none;}
a:hover{color:#F30;text-decoration:underline;}
input{padding:0px;margin:0px;}
.txtbox{border:1px solid #E79F50;height:20px;line-height:22px;width:120px;}
.bfont{font:700 12px "宋体"};
#login{width:400px;height:100%;overflow:hidden;margin:0px auto;}
#title{width:400px;height:25px;line-height:25px;color:#F60;font-weight:700;background-color:#FDEBD9;text-align:center;margin:0px auto;}
#loginbox{width:185px;height:60px;margin:10px 20px;float:left;display:inline;}
#btnlogin{width:55px;height:60px;float:right;margin:10px 30px 10px 5px;}
#forget{width:200px;margin:0px auto;height:25px;line-height:25px;text-align:center;}
#forget span{width:80px;display:inline;margin:0px 10px;}
</style>
<body>
<div id="login">
<div id="title">个人登录后才能投递简历,没有注册请先注册成为个人会员。</div>
<div style="width:320px;height:80px;margin:0px auto;">
<table id="loginbox" border="0" cellpadding="0" cellspacing="0">
<tr style="height:30px">
<td class="bfont">用户名:</td>
<td><input class="txtbox" type="text" name="username" /></td>
</tr>
<tr>
<td class="bfont">密  码:</td>
<td><input class="txtbox" type="password" name="password" /></td>
</tr>
</table>
<div id="btnlogin"><a href="#"><img src="images/login.gif" width="55" height="55" /></a></div>
</div>
<div id="forget">
<span style="float:left;"><a href="#">忘记密码?</a></span>
<span style="float:right;"><a href="#">没有注册?</a></span>
</div>
<div style="height:25px;line-height:25px;text-align:center">马上注册并填写简历,你就会得到更多更好的机会。 <a style="color:#06F;text-decoration:underline;font-weight:700" href="#">点击注册</a></div>
</div>
</body>
</html>
harry960 2012-09-19
  • 打赏
  • 举报
回复
使用jQuery就行,参见http://jqueryui.com/demos/dialog/


<script>
$(function() {
$( "#dialog" ).dialog();
});
opendlg(){
$.get('asp.net页面吗地址', {参数名1:参数值1, 参数名2:参数值2}, function(data){
$("#dlgContent").html(data);//data是返回的HTML
$( "#dialog" ).dialog('open')
}
}
</script>
<a href='javascript:opendlg()'>打开</a>
<div id="dialog" title="Basic dialog">
<div id='dlgContent'>初始内容</div>
</div>
色拉油 2012-09-19
  • 打赏
  • 举报
回复
jquery dialog 插件
haojuntu 2012-09-18
  • 打赏
  • 举报
回复
是不是这样的
window.open ('page.aspx','newwindow','height=100,width=400,top=0,left=0,toolbar=no,menubar=no,scrollbars=no, resizable=no,location=no, status=no')
取个昵称不难 2012-09-18
  • 打赏
  • 举报
回复
showmodeldialog
孟子E章 2012-09-18
  • 打赏
  • 举报
回复
[Quote=引用 3 楼 的回复:]

引用 1 楼 的回复:
你 的意思是弹出的内容是aspx页面?使用iframe即可

window.open 即可弹出aspx页面
不知道怎么弹出 iframe请大牛说下
[/Quote]

层里面写iframe
CrazyCode1981 2012-09-18
  • 打赏
  • 举报
回复
你百度一下模窗体 我以前用过 应该是你要的效果
baishaoge 2012-09-18
  • 打赏
  • 举报
回复
[Quote=引用 1 楼 的回复:]
你 的意思是弹出的内容是aspx页面?使用iframe即可
[/Quote]
window.open 即可弹出aspx页面
不知道怎么弹出 iframe请大牛说下
cykb518 2012-09-18
  • 打赏
  • 举报
回复
这种情况一般都是弹出div而不是一个页面。
孟子E章 2012-09-18
  • 打赏
  • 举报
回复
你 的意思是弹出的内容是aspx页面?使用iframe即可

62,253

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术交流专区
javascript云原生 企业社区
社区管理员
  • ASP.NET
  • .Net开发者社区
  • R小R
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

.NET 社区是一个围绕开源 .NET 的开放、热情、创新、包容的技术社区。社区致力于为广大 .NET 爱好者提供一个良好的知识共享、协同互助的 .NET 技术交流环境。我们尊重不同意见,支持健康理性的辩论和互动,反对歧视和攻击。

希望和大家一起共同营造一个活跃、友好的社区氛围。

试试用AI创作助手写篇文章吧