打开 aspx 页面作为模式弹出窗口
我有一个带有编辑选项的网格,在编辑按钮上单击我需要重定向到编辑页面。 要求是将此编辑页面作为弹出窗口,背景(上一页)呈灰色。
我尝试了模式弹出窗口,但控件位于单独的页面上。
我尝试使用面板和 Iframe 进行模式弹出:这有效。但是出现了另一个问题。我需要在“保存”或“取消”按钮上关闭页面,然后单击。这些控件将位于编辑页面上,而不是在上一个页面上页。任何帮助表示赞赏。
谢谢 拉贾特
I have a grid with edit option ,and on edit button click i need to redirect to an edit page .
the requirement is to get this edit page as a popup with background (prev page) greyed out.
i tried modal popup, but the controls are on a separate page .
i tried modal popup with panel and a Iframe : this works..but thean another problem arises.i need to close the page on 'SAVE' or 'Cancel' butotn click .these controls would be on the edit page and not on the prev page .any help is appreciated .
Thanks
Rajat
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
我强烈建议使用用户控件,因为它会更方便您管理,并且没有必要为其创建整个页面,因为 bcz 模式弹出窗口使用 ajax 请求,如果您尝试在其中加载页面,那么您就可以了做表单发布...这不符合使用ajax请求或表单发回...
加上我正在寻找你的问题的答案,我发现了这篇文章,它说:
http:// /wiki.asp.net/page.aspx/1378/open- Different-page-using-ajax-modal-popup-extender-control/
还发现人们问与您相同的问题以及他们得到的答复在这里
有没有办法使用 ModalPopup Extender 打开另一个页面?
我建议修改您的设计,因为它不会造成任何损害,相反,它会更有帮助......
希望这有所帮助......
i'll strongly suggest to use user control as it'll be more handy for you to manage and there is no point creating a whole page for it bcz modal popup uses ajax request and if you try to load the page in it then you have to do form post ... which doesn't go along either use ajax request or form post back ...
plus i was looking for the answer of ur question and i came across this article where it says:
http://wiki.asp.net/page.aspx/1378/open-different-page-using-ajax-modal-popup-extender-control/
and also found people asking same question as you did and the response they got is here
Is there a way to open another page using ModalPopup Extender?
and i'll suggest to modify your design as it doesn't do any harm, instead it'll be much more helpful ...
hope this help ...
我已经多次使用 AJAX 控件工具包中的模态弹出控件,并取得了很好的成功:
http://www.asp.net/ajax/ajaxcontroltoolkit/Samples/ModalPopup /ModalPopup.aspx
I've used the Modal Popup Control from the AJAX Control Toolkit several times with good success:
http://www.asp.net/ajax/ajaxcontroltoolkit/Samples/ModalPopup/ModalPopup.aspx
如果您使用 bootstrap Modal,那么您可以将 iframe 添加到模态主体中,并在其中加载页面的 url。
If you are using bootstrap Modal then you can add an iframe into the modal body and load the url of your page inside it.
只是一个想法,但是使用 jquery“contents()”函数怎么样?
您可以设置一个间隔来从父页面查找 iframe 内的元素。
(您使用的是 .net,因此您可以使其在 iframe 页面回发时显示)。
上面的内容是在 iframe 页面中查找 id 为“closeModal”的元素。当该元素出现时,您可以调用模式的关闭函数(只需将警报替换为调用)。
Just an idea but what about using the jquery "contents()" function?
You could set an interval to look for an element within the iframe from the parent page.
(You're using .net so you could make it appear upon postback on the iframe's page).
The above is looking for an element within the iframe-page with an id of "closeModal". When that element appears you can make a call to the modal's close function, (just replace the alert with the call).
我们可以使用 IFrame 打开一个 aspx 作为弹出窗口,如下所示,
首先使用一个按钮并提供 onclick 事件,如下所示
下一步在页面中提供一个带有 id 的“Div”标签,
如下然后找到下面的两个方法,它们采用当前 URL 并打开一个使用 IFRAME 弹出的 aspx 页面
发送的四个参数如下 URL、高度、宽度、标题
We can open an aspx as popup using IFrame as follows,
First take a button and provide onclick event as follows
Next In the page provide a "Div" tag with id as follows
Then find below the two methods which take the present URL and opens a aspx page in a popup using IFRAME
The Four parameters are sent as follows URL,height,width,title