江湖救急!!!asp登陆成功后显示一个自动弹出窗口,登陆不成功则弹出"用户登陆失败"

asp登陆成功后显示一个自动弹出窗口,在右下角弹出“欢迎某某某(对应用户)”登陆不成功则弹出"用户登陆失败",可以实现么,江湖救急,各位高手帮帮忙!!!虽然分值少,但是全部奉献。
类似于QQ弹出的消息对话框,希望详细点,偶是asp菜鸟 ,实现的自动窗口像这里的http://zhidao.baidu.com/question/60485437.html?si=4
代码,但是登陆成功后才弹出,不成功则弹出"用户登陆失败",(要源码)谢谢

以下代码就是:不过你自己要稍微改改:
<script language="javascript">
var divTop,divLeft,divWidth,divHeight,docHeight,docWidth,i = 0;
var popupMessage = new Object();
popupMessage.id = 'popupMessage';
popupMessage.obj = function(){
return document.getElementById(popupMessage.id);
};
popupMessage.onLoad = function(){
try{
divTop = parseInt(popupMessage.obj().style.top,10);
divLeft = parseInt(popupMessage.obj().style.left,10);
divHeight = parseInt(popupMessage.obj().offsetHeight,10);
divWidth = parseInt(popupMessage.obj().offsetWidth,10);
docWidth = document.body.clientWidth;
docHeight = document.body.clientHeight;

popupMessage.obj().style.top = parseInt(document.body.scrollTop,10) + docHeight + 10;
popupMessage.obj().style.left = parseInt(document.body.scrollLeft,10) + docWidth - divWidth;
popupMessage.obj().style.visibility="visible";
popupMessage.timer = window.setInterval(popupMessage.move,2);

}
catch(e){}
};
popupMessage.onResize = function(){
i+=1;
if(i>1000) popupMessage.close();
try{
divHeight = parseInt(popupMessage.obj().offsetHeight,10);
divWidth = parseInt(popupMessage.obj().offsetWidth,10);
docWidth = document.body.clientWidth;
docHeight = document.body.clientHeight;
popupMessage.obj().style.top = docHeight - divHeight + parseInt(document.body.scrollTop,10);
popupMessage.obj().style.left = docWidth - divWidth + parseInt(document.body.scrollLeft,10);
}
catch(e){}
};
popupMessage.move = function(){
try
{
if(parseInt(popupMessage.obj().style.top,10) <= (docHeight - divHeight + parseInt(document.body.scrollTop,10)))
{
window.clearInterval(popupMessage.timer);
popupMessage.timer = window.setInterval(popupMessage.onResize,1);
}
divTop = parseInt(popupMessage.obj().style.top,10);
popupMessage.obj().style.top = divTop - 1;
}
catch(e){}
};
popupMessage.close = function(){
if(popupMessage.obj()) popupMessage.obj().parentNode.removeChild(popupMessage.obj());
if(popupMessage.timer) window.clearInterval(popupMessage.timer);
};
popupMessage.createInstance = function(bodyHtml){
try
{
if(popupMessage.obj())popupMessage.obj().parentNode.removeChild(popupMessage.obj());
if(popupMessage.timer) window.clearInterval(popupMessage.timer);
i=0;
var odiv = document.createElement('DIV');
odiv.id = popupMessage.id;
odiv.style.width="199px";
odiv.style.height="auto";
odiv.style.visibility="hidden";
odiv.style.position="absolute";
odiv.style.zIndex="99999";
odiv.style.left="0px";

odiv.innerHTML = bodyHtml;
document.body.appendChild(odiv);

}
catch(e){}
};

window.onresize = popupMessage.onResize;

function popupMessagePopup(bodyHtml)
{
popupMessage.createInstance(bodyHtml);
popupMessage.onLoad();
}

popupMessage.convertWin = function(){
var msg = document.getElementById('msgContent');
var contentdis = document.getElementById('btContent');
var flg = msg.style.display=="none";
if(flg)
{
contentdis.innerHTML = '—';
contentdis.title='最小化窗口';
msg.style.display = "block";
}
else
{
contentdis.innerHTML = '□';
contentdis.title='最大化窗口';
msg.style.display = "none";
}
}

function myPopup()
{
popupMessagePopup('<div style="width:199px; height:auto;font-size:12px;border:solid 1px #3399FF;background-color:#CFDEF4; ">'+
'<div style="width:199px;height:20px; float:left; ">'+
'<span style="width:140px;float:left;text-align:left;text-indent:8px;padding:4px; color:#0C53C5;">消息提示</span>'+
'<span title="关闭" style="width:15px;border-width:0px;float:right;margin-right:5px;padding:4px; color:Red; cursor: hand; font-weight:bold;" onclick="popupMessage.close();return false;">×</span>'+
'<span id="btContent" title="最小化窗口" style="width:15px;border-width:0px;float:right;padding:4px 4px 4px 4px; margin-right:7px;color:Red;cursor: hand;font-weight:bold;" onclick="popupMessage.convertWin();">—</span>'+
'</div>'+
'<div id="msgContent" style="width:199px;height:60px; float:left;WORD-BREAK: break-all; padding:8px 8px 8px 8px;border-top:solid 1px #3399FF; text-align:left; text-indent:10px; "><a href="#" target="_blank" style="font-size:15px; color:Red;">欢迎登陆</a></div>'+
'</div>');
}

window.onload = myPopup;

</script>
温馨提示:内容为网友见解,仅供参考
第1个回答  2009-04-13
if 登陆成功 then
Response.Write("<script>alert('欢迎某某某')</script>")
else
Response.Write("<script>alert('用户登陆失败')</script>")
end if
第2个回答  2009-04-13
<%登录成功的代码%>
<script language="javascript">
alert("欢迎<%session%>!");
window.location="这里写你要跳转的页面"
</script>
<%else%>
<script language="javascript">
alert("用户登陆失败!");
window.location="同上"
</script>
<%end if%>
第3个回答  2009-04-13
登陆成功后,赋个session("username")=用户名

ASP如何关闭浏览器让用户自动退出?
我没有用asp,但是可以分享一下解决问题的思路:你要实现同一时间同一帐户只有一个登录,可以结合用户的帐号和 登录ip来判定(建一张表记录登录的帐号和ip,QQ就是这样做的),同时可以换一下位置:同一帐号后登陆 的,ip不同的有效,同时修改该帐号登录的ip;if(帐号==\\"该帐号\\"&&ip==\\"以前登...

相似回答