如题,该页面是一个内容页<asp:Content>XXXXXXXX
我用JS show一个模态窗体,然后判断返回值,确定代码走到window.location =location; 这一句
页面就是不刷新,是什么情况?其他页面都能正常刷新。求解答,各种可能造成该原因的情况例举出来都有分~
我用JS show一个模态窗体,然后判断返回值,确定代码走到window.location =location; 这一句
页面就是不刷新,是什么情况?其他页面都能正常刷新。求解答,各种可能造成该原因的情况例举出来都有分~
解决方案 »
- 求教高手,关于日历控件My97DatePicker在IE8下的问题
- GridView里设置绑定字段格式的问题
- 我要设置我上传文件最大为5M.谁能给我答案?
- 怎样用DataGrid的HyperLinkColum传多值
- 用javascript 在 ListBox里添加了一些项目,可在后台页面处理代码里发现根本没有这些项?
- 访问用ASP.net做的网站后,总出现访问数据库出错的问题,怎么办
- 高分求救
- 我用WebClient.UploadFile上传的图片总是无法显示,为什么
- 为什么我在引用acme的时候会出现未找到命名空间的错误呢?
- 怎样在本地调试asp.net程序
- 为什么在VS2008中运行网站时总是弹出要求输入用户名和密码
- 有没有办法有效提高asp.net读写数据库的效率
if(url.indexOf('?')>0){
url+=("&t="+Math.random());
}else{
url+=("?t="+Math.random());
}
window.location =url;
showModalDialog(xxxx)
window.location =location
<%@ Page Title="" Language="C#" MasterPageFile="~/Master/Main.Master" AutoEventWireup="true"
CodeBehind="XXX.aspx.cs" Inherits="XXXX" %>
<asp:Content ID="Content1" ContentPlaceHolderID="Content" runat="server">js:
function ApplyTech(PatentID, PTCheckID, PageType) {
var result = window.showModalDialog("../Patent/ApplyTechNotes.aspx?PatentID=" + PatentID + "&PTCheckID=" + PTCheckID + "&PageType=" + PageType + "&Rnd=" + Math.random() + "&type=Agree", '', "dialogwidth=700px;dialogheight=300px;");
if (typeof (result) != "undefined") {
if (result == "OK") {
alert("操作成功!");
window.location = window.location;
//document.getElementById("ctl00_Content_btnRefresh").click();//此处调用后台刷新gridview按钮事件,也不刷新
}
}
}
确定走window.location =location
这一句
上面我贴了代码,弹出“操作成功!”的提示
弹出来了吗?
你可以采用#2楼的方法加随机数
测试下
会有这种问题吗?
try
{
nPTCheckID = Convert.ToInt32(StringOperate.GetQueryString("PTCheckID", "0"));
nPatentID = Convert.ToInt32(StringOperate.GetQueryString("PatentID", "0"));
string sPageType = StringOperate.GetQueryString("PageType", "");
if (!(this.ckbIfSend.Checked == false && sPageType == "R"))
{
new PatentCheckManager().SubmitTechNotes(nPTCheckID, Convert.ToInt32(new PatentCheckManager().GetSingle(nPTCheckID).n_RoleID), nPatentID);
}
//保存文件
int nFileID = SaveAddFileInfo();
//保存操作信息
SaveNote(nFileID); Response.Write("<script>window.returnValue='OK';window.close()</script>");
}
catch (Exception ex)
{
Response.Write("<script>window.returnValue='Wrong';window.close();</script>");
}
这是模态窗体中返回代码,是在所有操作完了才returnValue的啊
第一次发现这个问题的时候,就改用reload()了,不刷新的,谢谢~
你确定是window?而不是iframe的窗口名?还有比如window.parent,比如popup窗口操作的时候必须加parent