关闭,但功能可以在html中使用,但不能在.net中使用 [英] close but function is work in html but not .net

查看:58
本文介绍了关闭,但功能可以在html中使用,但不能在.net中使用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

 <  !DOCTYPE   html   PUBLIC    -//W3C//DTD   XHTML     1.0  过渡//EN"     <   html     ="   http://www.w3.org/1999/xhtml" > 
<  头部 > 
<      ="   Content-Type"   内容  ="  text/html; charset = iso-8859-1" / > 
<  标题 >  XHTML测试:关闭当前窗口<  /title  > 
<  脚本       JavaScript"    类型    ="      > 
            函数closeMe()
            {
                如果(navigator.appName!="Microsoft Internet Explorer"){
                netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserWrite");
            }

            window.open('','_self');
            window.close();

            }
    <  /script  > 
<  /head  > 
<  正文 > 
<   > 
<   td  > 
 <  输入    ="   btnClose" 样式  字体粗细:粗体;字体大小:11像素;背景颜色:#104e8b;边框底部宽度:薄;颜色:白色;" 类型  ="    关闭"  onclick    javascript:closeMe();" / > 
<  /td  > 
<  /table  > 
<  /body  > 
<  /html  >  



上面的关闭按钮的js函数正在工作的html页面,但是在asp.net中却没有,任何人都建议对此做任何解决方案.网".您要问的内容与说关闭窗户在我家的房间中有效,而在Microsoft Windows中不起作用"相同.

从客户端的角度来看,没有ASP.NET.如果这是HTML页面,则客户端将看不到它是从服务器上的静态文件还是从ASP.NET程序传递的任何区别.请执行以下操作:运行服务器,在Web客户端中加载页面,然后将加载的页面保存在本地硬盘上的文件中.将此文件与您在问题中显示的HTML文件进行比较-您将立即看到不同之处.

—SA


<!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=iso-8859-1" />
<title>XHTML Test : Close Current Window</title>
<script language = "JavaScript" type ="text/javascript"  >
            function closeMe()
            {
                if (navigator.appName != "Microsoft Internet Explorer") {
                netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserWrite");
            }

            window.open('', '_self');
            window.close();

            }
    </script>
</head>
<body>
<table>
<td>
 <input id="btnClose" style="font-weight: bold;font-size: 11px;background-color:#104e8b;border-bottom-width:thin;color:White;" type="button" value="Close" onclick="javascript:closeMe();" />
</td>
</table>
</body>
</html>



above js function for close button is working html page but not in asp.net any one suggest any solution on that.

解决方案

There is no "HTML vs. ASP.NET". What you ask is the same as saying "Close a window works in my home''s rooms, but not in Microsoft Windows".

From the client perspective, there is no ASP.NET. If this is an HTML page, a client cannot see any difference it is delivered from a static file on the server or from an ASP.NET program. Do the following: run your server, load your page in Web client and save the loaded page in a file on your local hard disk. Compare this file with the HTML file you show in your question — you will immediately see the difference.

—SA


这篇关于关闭,但功能可以在html中使用,但不能在.net中使用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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