ASP.NET Javascript模态弹出窗口不会在第二次激活页面加载 [英] ASP.NET Javascript Modal Popup won't fire Page Load on second go

查看:61
本文介绍了ASP.NET Javascript模态弹出窗口不会在第二次激活页面加载的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Hello All


希望你能提供帮助


我一直在讨论ASP.NET中的弹出问题。我写的

表单之一要求用户从

弹出网页表单中的列表中选择一个产品。弹出窗口上有一个DataGrid和page.load

函数DataBinds就像你期望的那样。


我在C#中有Code-Behind发出调用JavaScript函数

使用showModalDialog()来显示弹出窗口。从父页面中选择产品列表

并插入Session []变量。这个

Session []变量被弹出窗口拾取并成功绑定到数据网格

。弹出窗口中会发出更多的JavaScript,以便将一组数据返回给父级,并调用window.close()。


但是,当用户必须选择第二个产品时,弹出窗口

不会触发它的Page.load方法,而DataGrid仍然保留它的

旧数据。数据肯定在Session []商店中,因为我预期

它。


如何让弹出窗口正确关闭以便page.load活动

每次都会开火?


希望它有意义

解决方案

>如何正确关闭弹出窗口,以便每次都会触发page.load事件




不确定,但我认为window.open()调用有一个属性来命名

打开窗口(对于ref),如果是这样,请尝试生成一个随机名称(时间

)作为名称确保它是新的窗口......


快速思考


-

Curt Christianson

site: http://www.darkfalz.com

博客: http://blog.darkfalz.com


如果我已经理解了这一点,那么当你完成弹出窗口后,你正试图让父页面重新加载。

如果是这种情况,以及关闭弹出窗口,请尝试将父母

页面重定向到自己


javascript :window.opener.parent.location =''MyUrl.aspx'';


HTH


" H00ner" < ti*@slashwoot.com>在消息中写道

news:11 ********************** @ f14g2000cwb.googlegr oups.com ...

Hello All

希望你能提供帮助

一直在讨论ASP.NET中的弹出问题。我写的
表单之一要求用户从弹出的Web表单中的列表中选择产品。弹出窗口上有一个DataGrid和page.load
函数DataBinds就像你期望的那样。

我在C#中有Code-Behind来发出对JavaScript函数的调用
使用showModalDialog()来显示弹出窗口。从父页面中选择产品列表并将其插入Session []变量中。这个
Session []变量由弹出窗口拾取并成功绑定到数据网格。弹出窗口中会发出更多的JavaScript,以便将一组数据返回给父级,并调用window.close()。

然而,当用户必须选择一个第二个产品,弹出窗口
并没有触发它的Page.load方法,而DataGrid仍保留着它的旧数据。数据肯定在Session []商店中,正如我预期的那样。

如何让弹出窗口正常关闭,以便page.load事件每次都会触发?

希望有意义



并且刚刚在google上找到,你也可以这样做:

javascript :window.opener.location.reload()


" H00ner" < ti*@slashwoot.com>在消息中写道

news:11 ********************** @ f14g2000cwb.googlegr oups.com ...

Hello All

希望你能提供帮助

一直在讨论ASP.NET中的弹出问题。我写的
表单之一要求用户从弹出的Web表单中的列表中选择产品。弹出窗口上有一个DataGrid和page.load
函数DataBinds就像你期望的那样。

我在C#中有Code-Behind来发出对JavaScript函数的调用
使用showModalDialog()来显示弹出窗口。从父页面中选择产品列表并将其插入Session []变量中。这个
Session []变量由弹出窗口拾取并成功绑定到数据网格。弹出窗口中会发出更多的JavaScript,以便将一组数据返回给父级,并调用window.close()。

然而,当用户必须选择一个第二个产品,弹出窗口
并没有触发它的Page.load方法,而DataGrid仍保留着它的旧数据。数据肯定在Session []商店中,正如我预期的那样。

如何让弹出窗口正常关闭,以便page.load事件每次都会触发?

希望有意义



Hello All

Hope you can help

Been pulling my hair out about a popup problem in ASP.NET. One of the
forms i wrote requires the user to select a product from a list in a
popup web form. the popup has a DataGrid on it and the page.load
function DataBinds as you''d expect.

I have Code-Behind in C# to emit a call to a JavaScript function which
uses showModalDialog() to show the popup. The product list is selected
from the parent page and inserted into a Session[] variable. This
Session[] variable is picked up by the popup and binds to the datagrid
successfully. A little more JavaScript is emitted in the popup to get
an array of data back to the parent, and also call window.close().

However, when the user has to select a second product, the popup
doesn''t fire it''s Page.load method and the DataGrid remains with it''s
old data. The data is definitely in the Session[] store as i expected
it.

How can i get the popup to close properly so that the page.load event
fires every time?

hope it makes sense

解决方案

> How can i get the popup to close properly so that the page.load event

fires every time?



Not sure but I think the window.open() call has an attribute to name the
opening window (for ref) and if so try generating a random name (time
perhaps) as the name to ensure it''s a "new" window...

Just a quick thought

--
Curt Christianson
site: http://www.darkfalz.com
blog: http://blog.darkfalz.com


if i''ve understood this properly, you are trying to get the Parent page to
reload once you have finished with the popup window.

If this is the case, as well as closing the popup, try redirect the Parent
page to itself

javascript: window.opener.parent.location=''MyUrl.aspx'';

HTH

"H00ner" <ti*@slashwoot.com> wrote in message
news:11**********************@f14g2000cwb.googlegr oups.com...

Hello All

Hope you can help

Been pulling my hair out about a popup problem in ASP.NET. One of the
forms i wrote requires the user to select a product from a list in a
popup web form. the popup has a DataGrid on it and the page.load
function DataBinds as you''d expect.

I have Code-Behind in C# to emit a call to a JavaScript function which
uses showModalDialog() to show the popup. The product list is selected
from the parent page and inserted into a Session[] variable. This
Session[] variable is picked up by the popup and binds to the datagrid
successfully. A little more JavaScript is emitted in the popup to get
an array of data back to the parent, and also call window.close().

However, when the user has to select a second product, the popup
doesn''t fire it''s Page.load method and the DataGrid remains with it''s
old data. The data is definitely in the Session[] store as i expected
it.

How can i get the popup to close properly so that the page.load event
fires every time?

hope it makes sense



and just found on google, you can also do:

javascript: window.opener.location.reload()

"H00ner" <ti*@slashwoot.com> wrote in message
news:11**********************@f14g2000cwb.googlegr oups.com...

Hello All

Hope you can help

Been pulling my hair out about a popup problem in ASP.NET. One of the
forms i wrote requires the user to select a product from a list in a
popup web form. the popup has a DataGrid on it and the page.load
function DataBinds as you''d expect.

I have Code-Behind in C# to emit a call to a JavaScript function which
uses showModalDialog() to show the popup. The product list is selected
from the parent page and inserted into a Session[] variable. This
Session[] variable is picked up by the popup and binds to the datagrid
successfully. A little more JavaScript is emitted in the popup to get
an array of data back to the parent, and also call window.close().

However, when the user has to select a second product, the popup
doesn''t fire it''s Page.load method and the DataGrid remains with it''s
old data. The data is definitely in the Session[] store as i expected
it.

How can i get the popup to close properly so that the page.load event
fires every time?

hope it makes sense



这篇关于ASP.NET Javascript模态弹出窗口不会在第二次激活页面加载的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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