上传文件后出现一个弹出窗口,
ClientScript.RegisterStartupScript (Me.GetType(), "Javascript", "javascript:
window.open ('http://rsspl05/DocAdmin/confirmmsg.aspx?tdnum=" & TDnum &
"','mywindow','width=800,height=400,location=no');", True)
但是我得到的弹出窗口是一个空白页面,其中包含页面源:
<!-- beginning of HttpRedirect.htm file -->
<script type="text/javascript">
function redirectToHttps()
{
var httpURL = window.location.hostname+window.location.pathname;
var httpsURL = "https://" + httpURL ;
window.location = httpsURL ;
}
redirectToHttps();
</script>
<!-- end of HttpRedirect.htm file -->
实际的aspx代码是:
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Confirmmsg.aspx.vb" Inherits="docadmin_Confirmmsg" %>
<!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 runat="server">
<title>Technical Documents</title>
<link href="StyleSheet.css" rel="stylesheet" type="text/css" />
<script language="javascript" type="text/javascript">
function confirmmsg(val)
{
// // alert(val + ' has been uploaded successfully.');
//
//if(confirm("Do you want to upload another document?")==true){
// window.location.href="UploadDoc.aspx";
///}else{
// window.location.href="../Search.aspx";
// }
self.close();
}
</script>
</head>
<body>
<form id="form1" runat="server">
<div style="text-align:center">
The document has been successfully uploaded.The link to the document:<asp:HyperLink
ID="lnkpath" runat="server" Target="_blank" Visible="false">HyperLink</asp:HyperLink>
<br /><asp:Button ID="btnOk" runat="server" Text="OK" /></div>
</form>
</body>
</html>
最佳答案
确保以下几件事:
- 您正在调用正确的网址/文件
- 您的 aspx 页面正在继承正确的代码隐藏文件
检查弹出代码隐藏文件中是否没有任何内容会导致问题
仔细检查最终(不正确)的弹出 URL,看看它是否是您调用的文件,如果它重定向到其他内容,请跟踪/调试您的流程,看看是什么原因导致的。
里>
这只是一个非常通用的选项,所以如果您发现了什么,请告诉我。希望对您有所帮助。
关于javascript - 页面 View 不符合预期,html 未出现,页面为空白,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10313696/