modlapopup显示时如何传递参数?
来源:互联网 发布:js判断不等于 编辑:程序博客网 时间:2024/06/05 16:05
http://mattberseth.com/blog/2007/07/modalpopupextender_example_for.html
ModalPopupExtender Example for Editing Rows in a GridView (Master/Detail Scenario)
The web application I am currently working on is a data-centric, internal facing application targeted at the knowledge workers within our enterprise. A majority of the pages are our core 'search' pages that contain a GridView and a number of input elements for entering search criteria. Each row in our GridViews contain a hyperlink to a supporting 'details' page that has additional information for the selected row - usually contained in a DetailsView. Our standard for implementing this has been to render the values for the GridViews primary key column as a hyperlink that takes the user to the details page passing the PK through the query string. This all works fine and our users seem to be OK with this type of naviagation. But when I was recently doing some work with the ModalPopupExtender, I was curious if we could improve this flow by keeping the user on the main search page by moving the DetailsView to the ModalPopupExtender. See the screen shot below or the live demo for an example.
Live Demo | Download Code
I did a few google searches, and sure enough there were some people doing this (here and here). I took a similiar approach to the second article, but with a few minor tweaks. I uploaded a live demo of these pages so you can check out the behavior (I kept the styling to a minimum as usual). The code for this example is straight-forward except for the following 3 items:
1. The ModalPopupExtender requires the TargetControlID property to be set. Because of this I created a hidden button so this error doesn't occur. For this example, we don't need to set a control to trigger the popup because we are always explicitly calling Show() on the popup when the Details button is clicked).
2. The DetailsView for the selected row is contained in an updatepanel with the UpdateMode set to Conditional. This is done because we want to make sure that the control is only updated from the Details button click handler and not when the Customers GridView is sorted or paged through
3. We are explicitly calling Show on the ModalPopup to display the DetailsView from the 'Details' button click event. This is the only action that triggers the ModalPopup from being made visible
Also, I didn't actually implement an update because I don'y want my northwind database getting messed up. Hopefully this will get you enough of a start that implementing the update will not be a huge problem.
Here is the markup for the page, Enjoy!
<%@ Page Language="C#" %><%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="ajaxToolkit" %>Master Details Example .modalBackground { background-color:Gray; filter:alpha(opacity=70); opacity:0.7; }
这里的核心思想是手动控制modalpopup的显示,然后它的属性TargetControlID设置成一个不现实的button的id。
- modlapopup显示时如何传递参数?
- setTimeOut如何传递参数
- 多线程如何传递参数
- 通过url传递参数时,如何获取全部参数
- JSP 参数传递显示乱码
- COM参数如何传递数组
- 如何向线程传递参数
- 如何向线程传递参数
- window.showModalDialog()如何传递参数
- 如何向线程传递参数
- 如何给OPENQUERY传递参数
- 如何给OPENQUERY传递参数
- 指针参数如何传递内存
- JSP页面如何传递参数
- 如何为事件传递参数
- Apache AB 如何传递参数
- 指数参数如何传递内存
- 如何向线程传递参数
- 直方图均衡化
- android launcher 相关知识 开机启动 wallpape 图标的脱拽 如何取得Android已安装的应用程序
- gridview_查看当前信息
- Size 属性具有无效大小值: 0
- 总结Java开的多种API开发手册
- modlapopup显示时如何传递参数?
- 免费NET&C#开发参考资料合辑
- gcc头文件库文件搜索路径问题
- 如何使用dropdownlist实现listview分页?
- 初识R语言
- Get&Set
- spread extension for node.js
- 将搜狗浏览器中收藏夹导入到IE中的小工具
- 常用英语口语