模态对话 - 这几乎可行 [英] Modal Dialog - This Almost Works

查看:74
本文介绍了模态对话 - 这几乎可行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个模态对话框,目前除了项目

之外还执行以下所有操作。


1.让用户从列表中选择一个图形缩略图(当选择时,

在预览DIV中显示全尺寸图像)

2.当用户关闭对话框时,应用程序接收到
选择的图形。

3.模式对话框允许用户上传新图形,如果对话框确实

没有显示他们已经满意的图形使用。

4.上传新图片后,新上传的图片会与现有缩略图一起显示在

对话框中。


我开始的(并且项目1-3就好了)是一个框架集aspx页面

包括两个框架 - 一个框架用于缩略图,另一个框架

提供(1)所选

缩略图的全尺寸版本的预览区域,以及(2)上传新图形所需的控件。在

为了完成第4项,我有一个RegisterStartupScript行,它将使b / b $ b $导致缩略图帧重新加载。请注意,当自动查看框架集时,此设置

有效(所有项目1-4工作正常)。但是当作为模态对话框查看时,
,第4项不会发生......好像

RegisterStartupScript行没有被执行(但实际上是这样)。但是因为我需要将这个显示为模态对话框,所以这种安排不起作用。


我收到了一些建议,以摆脱框架集而是使用IFrame。

所以我将上面的框架集转换为一个包含两个

IFrame的aspx页面(一个用于缩略图,另一个用于全尺寸/预览和

上传控件)。这与以前一样,只是使用IFrame。仍然没有骰子。


所以,在这一点上,我认为有一个aspx页面

和一个IFrame可能是有意义的。 aspx页面将提供所有预览/上传

控件,IFrame将显示缩略图。这会给我所有的东西吗?

的1-4项目?


我肯定会感谢一些会给我所有项目的建议
1-4作为模态对话框。


谢谢!!!


-GH


I have a modal dialog that currently does all of the following except item
4.

1. lets users select a graphic from a list of thumbnails (and when selected,
displays the full-size image in a preview DIV)
2. when users close the dialog, the application receives the URL to the
selected graphic.
3. the modal dialog lets the users upload a new graphic if the dialog does
not present them with one they are already happy with.
4. upon uploading a new graphic, the newly uploaded graphic appears in the
dialog along with the existing thumbnails.

What I started with (and does items 1-3 just fine) was a frameset aspx page
that included two frames - one frame for the thumbnails, and another frame
that provided (1) a preview area for the full-sized version of the selected
thumbnail, and (2) the controls required for uploading new graphics. In
order to accomplish item 4, I had a RegisterStartupScript line that would
cause the thumbnail frame to reload itself. Please note that this setup
works (all items 1-4 work fine) when the frameset is viewed by itself. But
when viewed as a modal dialog, item 4 does not happen... as if the
RegisterStartupScript line isn''t executed (but it in fact is). But because I
need to display this as a modal dialog, this arrangement won''t work.

I received some advice to get away from a frameset and use IFrames instead.
So I converted the above frameset to be one aspx page that contains two
IFrames (one for thumbnails and the other for the full-size/preview and
upload controls). This is same as before, just with IFrames. Still no dice.

So, at this point I''m thinking it might make sense to have one aspx page
with one IFrame. The aspx page would provide all of the preview/upload
controls, and the IFrame would display the thumbnails. Would this get me all
of items 1-4?

I''d sure appreciate some suggestions that would would give me all of items
1-4 as a modal dialog.

Thanks!!!

-GH



推荐答案

您好,


尝试推荐:

< BASE target =" _self">


在你的< head>中标签。还有,它在做什么?没回帖?图片

不变?祝好运! Ken。


-

Ken Dopierala Jr.

对于优秀的ASP.Net网站托管尝试:
< a rel =nofollowhref =http://www.webhost4life.com/default.asp?refid=Spinlighttarget =_ blank> http://www.webhost4life.com/default.asp?refid=Spinlight

如果您在我这里注册并需要帮助,请给我发电子邮件。


Guadala Harry < GM ** @ NoSpam.com>在留言中写道

新闻:%2 **************** @ TK2MSFTNGP09.phx.gbl ...
Hi,

Try putting:

<BASE target="_self">

In your <head> tag. Also, what isn''t it doing? Not posting back? Image
not changing? Good luck! Ken.

--
Ken Dopierala Jr.
For great ASP.Net web hosting try:
http://www.webhost4life.com/default.asp?refid=Spinlight
If you sign up under me and need help, email me.

"Guadala Harry" <GM**@NoSpam.com> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
我有一个模态对话框,当前执行以下所有项目除了项目
4.

1.让用户从缩略图列表中选择一个图形(当选择
时,显示完整的 - 预览中的大小图像DIV)
2.当用户关闭对话框时,应用程序会收到选定图形的URL。
3.模态对话框允许用户上传新图形如果对话框没有显示他们已经满意的对象。
4.上传新图形后,新上传的图形将与现有缩略图一起显示在
对话框中。 br />
我开始使用(并且项目1-3就好了)是一个框架集aspx
页面,其中包括两个框架 - 一个用于缩略图的框架,另一个框架
提供(1)
所选缩略图的全尺寸版本的预览区域,以及(2)控件需要的预览区域用于上传新图形。为了完成第4项,我有一个RegisterStartupScript行,它将导致缩略图帧重新加载。请注意,当自动查看框架集时,此设置
有效(所有项目1-4工作正常)。但是当被视为模态对话框时,第4项不会发生......好像
RegisterStartupScript行没有被执行(但实际上是这样)。但是因为
我需要将它显示为模态对话框,这种安排不起作用。

我收到了一些建议,以摆脱框架集并使用IFrames
代替。所以我将上面的框架集转换为一个包含两个
IFrame的aspx页面(一个用于缩略图,另一个用于全尺寸/预览和
上传控件)。这与以前一样,只是使用IFrame。仍然没有
骰子。
所以,在这一点上,我认为有一个aspx页面和一个IFrame可能是有意义的。 aspx页面将提供所有预览/上传
控件,IFrame将显示缩略图。这会给我带来
所有项目1-4吗?

我肯定会欣赏一些可以给我所有项目的建议
1-4作为模态对话框。

谢谢!

-GH

I have a modal dialog that currently does all of the following except item
4.

1. lets users select a graphic from a list of thumbnails (and when selected, displays the full-size image in a preview DIV)
2. when users close the dialog, the application receives the URL to the
selected graphic.
3. the modal dialog lets the users upload a new graphic if the dialog does
not present them with one they are already happy with.
4. upon uploading a new graphic, the newly uploaded graphic appears in the
dialog along with the existing thumbnails.

What I started with (and does items 1-3 just fine) was a frameset aspx page that included two frames - one frame for the thumbnails, and another frame
that provided (1) a preview area for the full-sized version of the selected thumbnail, and (2) the controls required for uploading new graphics. In
order to accomplish item 4, I had a RegisterStartupScript line that would
cause the thumbnail frame to reload itself. Please note that this setup
works (all items 1-4 work fine) when the frameset is viewed by itself. But
when viewed as a modal dialog, item 4 does not happen... as if the
RegisterStartupScript line isn''t executed (but it in fact is). But because I need to display this as a modal dialog, this arrangement won''t work.

I received some advice to get away from a frameset and use IFrames instead. So I converted the above frameset to be one aspx page that contains two
IFrames (one for thumbnails and the other for the full-size/preview and
upload controls). This is same as before, just with IFrames. Still no dice.
So, at this point I''m thinking it might make sense to have one aspx page
with one IFrame. The aspx page would provide all of the preview/upload
controls, and the IFrame would display the thumbnails. Would this get me all of items 1-4?

I''d sure appreciate some suggestions that would would give me all of items
1-4 as a modal dialog.

Thanks!!!

-GH



我试过把< BASE target =" _self"> in(我将它放在包含IFrame的

aspx页面的< head>中)...没有骰子。


具体来说,是什么不工作的是,在上传新图片时,拇指框架中显示的

页面不会重新加载,因此用户

看不到新的缩略图上传的图片。


这是我希望会导致thumbFrame页面重新加载的代码。

此代码在后面的代码隐藏模块中执行加载到页面的页面

mainFrame。

string scriptString ="< script

language = JavaScript> parent.thumbFrame.location.rel oad (true)< / script>" ;;

if(!this.IsClientScriptBlockRegistered(" clientScri pt")){

this.RegisterStartupScript(" clientScript" ,scriptString);

}


这是ASPX页面中包含IFrame的所有代码(没有

代码隐藏逻辑f或者本页):

<%@ Page%>

<%@ OutputCache Location =" none" %>

<!DOCTYPE HTML PUBLIC" - // W3C // DTD HTML 4.01 Frameset // EN"

" http://www.w3 .org / TR / html4 / frameset.dtd">

< html>

< head>

< title>选择图像< / title>

< meta http-equiv =" Content-Type"含量=" text / html的; charset = iso-8859-1">

< BASE target =" _self">

< / head>

< body bottommargin =" 0" LEFTMARGIN = QUOT; 0" TOPMARGIN = QUOT; 0" rightmargin =" 0">

< form id =" Form1"方法= QUOT;交" runat =" server">

< table border =" 0" CELLPADDING = QUOT; 0" cellspacing =" 0">

< tr>

< td width =" 225px">

< iframe ID = QUOT; thumbFrame"名称= QUOT; thumbFrame" src =" SelectAssetThumbs.aspx"

frameborder =" 0"滚动= QUOT;汽车" style =" width:225px;身高:

410px">< / iframe>

< / td>

< td width =" 100%" ;>

< iframe id =" mainFrame"名称= QUOT; mainFrame中" src =" SelectAssetFull.aspx"

frameborder =" 0"滚动= QUOT;否] style =" width:100%;身高:410px">< / iframe>

< / td>

< / tr>

< / table>

< / form>

< / body>

< / html>


感谢您提供有关完成这项工作的任何指导!

-GH

Ken Dopierala Jr. < KD ********* @ wi.rr.com>在消息中写道

news:eT ************** @ tk2msftngp13.phx.gbl ...
I tried putting <BASE target="_self"> in (I placed it in the <head> of the
aspx page that contains the IFrames)... no dice.

Specifically, what is not working is that upon uploading a new image, the
page that appears in the thumbFrame does not reload, and therefore users
don''t see the thumbnail of the newly uploaded graphic.

Here is the code that I expect would cause the page in thumbFrame to reload.
This code executes in the code-behind module behind the page that loads into
mainFrame.
string scriptString = "<script
language=JavaScript>parent.thumbFrame.location.rel oad(true)</script>";
if(!this.IsClientScriptBlockRegistered("clientScri pt")){
this.RegisterStartupScript("clientScript", scriptString);
}

Here is all the code in the ASPX page that contains the IFrames (there is no
code-behind logic for this page):
<%@ Page %>
<%@ OutputCache Location="none" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN"
"http://www.w3.org/TR/html4/frameset.dtd">
<html>
<head>
<title>Select Image</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<BASE target="_self">
</head>
<body bottommargin="0" leftmargin="0" topmargin="0" rightmargin="0">
<form id="Form1" method="post" runat="server">
<table border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="225px">
<iframe id="thumbFrame" name="thumbFrame" src="SelectAssetThumbs.aspx"
frameborder="0" scrolling="auto" style="width: 225px; height:
410px"></iframe>
</td>
<td width="100%">
<iframe id="mainFrame" name="mainFrame" src="SelectAssetFull.aspx"
frameborder="0" scrolling="no" style="width: 100%; height: 410px"></iframe>
</td>
</tr>
</table>
</form>
</body>
</html>

Thanks for any guidance on making this work!

-GH

"Ken Dopierala Jr." <kd*********@wi.rr.com> wrote in message
news:eT**************@tk2msftngp13.phx.gbl...

尝试推荐:

< BASE target =" _self">

在你的< head>中标签。还有,它在做什么?没回帖?图片没有变化?祝好运! Ken。

- Ken Dopierala Jr.
对于伟大的ASP.Net网站托管尝试:
http://www.webhost4life.com/default.asp?refid=Spinlight
如果您注册在我的帮助下,请给我发电子邮件。

瓜达拉哈利 < GM ** @ NoSpam.com>在消息中写道
新闻:%2 **************** @ TK2MSFTNGP09.phx.gbl ...
Hi,

Try putting:

<BASE target="_self">

In your <head> tag. Also, what isn''t it doing? Not posting back? Image
not changing? Good luck! Ken.

--
Ken Dopierala Jr.
For great ASP.Net web hosting try:
http://www.webhost4life.com/default.asp?refid=Spinlight
If you sign up under me and need help, email me.

"Guadala Harry" <GM**@NoSpam.com> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
我有一个模态对话框,除了
项目4之外,目前执行以下所有操作。

1.让用户从缩略图列表中选择一个图形(当选择时,
I have a modal dialog that currently does all of the following except item 4.

1. lets users select a graphic from a list of thumbnails (and when selected,
显示完整的 - 预览中的大小图像DIV)
2.当用户关闭对话框时,应用程序会收到选定图形的URL。
3.模态对话框允许用户上传新图形如果对话框
没有显示他们已经满意的对象。
4.上传新图形后,新上传的图形将显示在
对话框中以及现有缩略图。

我开始的(并且项目1-3很好)是一个框架集aspx
displays the full-size image in a preview DIV)
2. when users close the dialog, the application receives the URL to the
selected graphic.
3. the modal dialog lets the users upload a new graphic if the dialog does not present them with one they are already happy with.
4. upon uploading a new graphic, the newly uploaded graphic appears in the dialog along with the existing thumbnails.

What I started with (and does items 1-3 just fine) was a frameset aspx


页面

包括两个框架 - 一个框架用于缩略图和另一个
帧,它提供了(1)全尺寸ver的预览区域选择
that included two frames - one frame for the thumbnails, and another frame that provided (1) a preview area for the full-sized version of the
缩略图


,以及(2)上传新图形所需的控件。为了完成第4项,我有一个RegisterStartupScript行,
会导致缩略图帧重新加载。请注意,当自动查看框架集时,此设置
有效(所有项目1-4工作正常)。
但是当被视为模态对话框时,第4项不会发生......好像
RegisterStartupScript行没有被执行(但实际上是这样)。但
因为我

thumbnail, and (2) the controls required for uploading new graphics. In
order to accomplish item 4, I had a RegisterStartupScript line that would cause the thumbnail frame to reload itself. Please note that this setup
works (all items 1-4 work fine) when the frameset is viewed by itself. But when viewed as a modal dialog, item 4 does not happen... as if the
RegisterStartupScript line isn''t executed (but it in fact is). But because I
需要将其显示为模态对话框,这种安排不起作用。

我收到了一些建议,以摆脱框架集而是使用IFrames
need to display this as a modal dialog, this arrangement won''t work.

I received some advice to get away from a frameset and use IFrames


所以我将上面的框架集转换为一个包含两个
IFrame的aspx页面(一个用于缩略图,另一个用于完整的-size / preview和
上传控件)。这与以前一样,只是使用IFrame。仍然没有
So I converted the above frameset to be one aspx page that contains two
IFrames (one for thumbnails and the other for the full-size/preview and
upload controls). This is same as before, just with IFrames. Still no


骰子。


所以,在这一点上,我认为拥有一个带有一个IFrame的aspx页面可能是有意义的。 aspx页面将提供所有预览/上传
控件,IFrame将显示缩略图。这会让我

So, at this point I''m thinking it might make sense to have one aspx page
with one IFrame. The aspx page would provide all of the preview/upload
controls, and the IFrame would display the thumbnails. Would this get me


项目1-4的所有


all

吗?

我肯定会感谢一些会给我所有的建议
of items 1-4?

I''d sure appreciate some suggestions that would would give me all of



项目1-4作为模态对话框。

谢谢!

-GH




好吧,如果你嫁给了一个模态对话框。 。 。


至少在IE中,对话框不支持导航(也不刷新)。因此

对话框不会自动刷新,因此在

后(或回发)后显示新的缩略图。我不确定嵌入在

对话框中的iframe的行为


我甚至不确定是否通过发布新的缩略图一个对话框将成功获得
。 。 。但是,如果是这样,下列解决方案中的一个可能会起作用:


1)当用户发布新文件时,关闭对话框并返回一个值

,用于标记打开对话框以重新显示对话框的代码。


2)使用客户端代码动态生成缩略图列表。

有很多方法可以用IE来做到这一点。但是对于独立于浏览器的

方法,我会使用带有

的ASPX文件填充/重新填充xml对象/标签.Response.ContentType =" text / xml" ;并使用生成的xml结构

构建/重建缩略图列表。


" Guadala Harry"写道:
Well, if your married to a modal dialog. . .

At least with IE, dialogs do not support navigation (nor refresh). Hence
the dialog will not refresh itself and thus display the new thumbnail after a
post (or postback). I''m not sure of the behavior of iframes embedded on a
dialog

I''m not even sure if the posting of the new thumbnail via a dialog will
succeed. . .but, if so, perhaps 1 of the following solutions would work:

1) When the user posts the new file, close the dialog and return a value
that flags the code that opened the dialog to redisplay the dialog.

2) Generate the list of thumbnails dynamically using client-side code.
There are a number of ways to do this with IE. But for a browser independent
method, I''d populate/repopulate an xml object/tag using an ASPX file with a
Response.ContentType="text/xml" and use the resulting xml structure to
build/rebuild the thumbnail list.

"Guadala Harry" wrote:
我有一个模态对话框,目前除了项目
之外还有以下所有内容。

1.让用户从中选择一个图形缩略图列表(选中时,
在预览DIV中显示全尺寸图像)
2.当用户关闭对话框时,应用程序会收到选定图形的URL。
3.模式对话框允许用户上传新图形,如果对话框没有显示他们已经满意的图形。
4.上传新图形时,新上传图形与现有缩略图一起出现在
对话框中。

我开始使用(并且项目1-3就好了)是一个框架集aspx页面
包括两个框架 - 缩略图的一个框架和另一个框架
,它提供(1)所选缩略图的全尺寸版本的预览区域,以及(2)上传新图形所需的控件。为了完成第4项,我有一个RegisterStartupScript行,它将导致缩略图帧重新加载。请注意,当自动查看框架集时,此设置
有效(所有项目1-4工作正常)。但是当被视为模态对话框时,第4项不会发生......好像
RegisterStartupScript行没有被执行(但实际上是这样)。但是因为我需要将它显示为模态对话框,所以这种安排不起作用。

我收到了一些建议,以摆脱框架集并改为使用IFrame。
所以我将上面的框架集转换为一个包含两个
IFrame的aspx页面(一个用于缩略图,另一个用于全尺寸/预览和
上传控件)。这与以前一样,只是使用IFrame。仍然没有骰子。

所以,在这一点上,我认为拥有一个带有一个IFrame的aspx页面可能是有意义的。 aspx页面将提供所有预览/上传
控件,IFrame将显示缩略图。这会让我得到1-4项目吗?

我肯定会感谢一些能给我所有项目的建议
1-4作为模态对话框。

谢谢!

-GH

I have a modal dialog that currently does all of the following except item
4.

1. lets users select a graphic from a list of thumbnails (and when selected,
displays the full-size image in a preview DIV)
2. when users close the dialog, the application receives the URL to the
selected graphic.
3. the modal dialog lets the users upload a new graphic if the dialog does
not present them with one they are already happy with.
4. upon uploading a new graphic, the newly uploaded graphic appears in the
dialog along with the existing thumbnails.

What I started with (and does items 1-3 just fine) was a frameset aspx page
that included two frames - one frame for the thumbnails, and another frame
that provided (1) a preview area for the full-sized version of the selected
thumbnail, and (2) the controls required for uploading new graphics. In
order to accomplish item 4, I had a RegisterStartupScript line that would
cause the thumbnail frame to reload itself. Please note that this setup
works (all items 1-4 work fine) when the frameset is viewed by itself. But
when viewed as a modal dialog, item 4 does not happen... as if the
RegisterStartupScript line isn''t executed (but it in fact is). But because I
need to display this as a modal dialog, this arrangement won''t work.

I received some advice to get away from a frameset and use IFrames instead.
So I converted the above frameset to be one aspx page that contains two
IFrames (one for thumbnails and the other for the full-size/preview and
upload controls). This is same as before, just with IFrames. Still no dice.

So, at this point I''m thinking it might make sense to have one aspx page
with one IFrame. The aspx page would provide all of the preview/upload
controls, and the IFrame would display the thumbnails. Would this get me all
of items 1-4?

I''d sure appreciate some suggestions that would would give me all of items
1-4 as a modal dialog.

Thanks!!!

-GH



这篇关于模态对话 - 这几乎可行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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