Window.open()打开一个窗体不被拦截
来源:互联网 发布:c语言开发手册 pdf 编辑:程序博客网 时间:2024/05/29 07:30
在DataGrid中建一个模板列,在模板列中放一个客户端的Button,或者直接写你要的字句,然后用<a href>连接
例:
<TABLE id="Table1" cellSpacing="0" cellPadding="0" width="100%" align="center" border="0">
<TR>
<TD width="100%">
<asp:datagrid id="dgFreightInfo" runat="server" Width="96%" GridLines="Horizontal" AllowCustomPaging="True"
AllowPaging="True" AutoGenerateColumns="False" DataKeyField="id" BorderColor="White" BorderWidth="1px"
PageSize="20">
<ItemStyle Height="25px" BackColor="#F7F7F7"></ItemStyle>
<HeaderStyle Font-Bold="True" HorizontalAlign="Center" Height="25px" BackColor="#E8E8E8"></HeaderStyle>
<Columns>
<asp:TemplateColumn>
<ItemTemplate>
<A href='javascript:onclick=LoadFreight(<%# DataBinder.Eval(Container,"DataItem.id")%>)'>
详细信息</A>
</ItemTemplate>
</asp:TemplateColumn>
</Columns>
</asp:datagrid>
</TD>
</TR>
然后写一个JavaScript方法
<script language="javascript">
function LoadFreight(id)//id为传进的参数
{
var url='url.aspx?tid='+id+'';
window.open(url,'','scrollbars=yes,top=0,left=0,resizable=no,status=no,toolbar=no,menubar=no,location=no,width=430,height=600');
}
</script>
例:
<TABLE id="Table1" cellSpacing="0" cellPadding="0" width="100%" align="center" border="0">
<TR>
<TD width="100%">
<asp:datagrid id="dgFreightInfo" runat="server" Width="96%" GridLines="Horizontal" AllowCustomPaging="True"
AllowPaging="True" AutoGenerateColumns="False" DataKeyField="id" BorderColor="White" BorderWidth="1px"
PageSize="20">
<ItemStyle Height="25px" BackColor="#F7F7F7"></ItemStyle>
<HeaderStyle Font-Bold="True" HorizontalAlign="Center" Height="25px" BackColor="#E8E8E8"></HeaderStyle>
<Columns>
<asp:TemplateColumn>
<ItemTemplate>
<A href='javascript:onclick=LoadFreight(<%# DataBinder.Eval(Container,"DataItem.id")%>)'>
详细信息</A>
</ItemTemplate>
</asp:TemplateColumn>
</Columns>
</asp:datagrid>
</TD>
</TR>
然后写一个JavaScript方法
<script language="javascript">
function LoadFreight(id)//id为传进的参数
{
var url='url.aspx?tid='+id+'';
window.open(url,'','scrollbars=yes,top=0,left=0,resizable=no,status=no,toolbar=no,menubar=no,location=no,width=430,height=600');
}
</script>
- Window.open()打开一个窗体不被拦截
- Window.open()打开一个窗体不被拦截
- window.open打开新窗口,不被拦截的方法
- window.open()方法打开新的一页不被浏览器拦截
- window.open不被拦截
- window.open()被拦截
- Response.Redirect 防止window.open新窗口打开被拦截
- window.open打开窗口被拦截的快速解决方法
- ajax打开新窗口window.open()被拦截的解决方法
- window.open不被拦截的实现代码
- window.open不被拦截的实现代码
- js实现window.open不被拦截的解决方法汇总
- window.open() 打开新窗体最大化、满屏.
- window.open打开一个新窗口
- window.open被浏览器拦截
- window.open()被拦截问题
- 利用Response.Redirect 在新窗口中打开,防止window.open新窗口打开被拦截
- js 打开一个新页面 window.open()
- 使用客户端的File Field控件上传图片
- 学习笔记
- 脐穿结果是好的哦【怀孕6个月咯!体重90斤】
- 在Global中使用线程隔时执行一项任务
- 如何增加缺少的序号?
- Window.open()打开一个窗体不被拦截
- 下载文件出现提示框或者直接显示在浏览器中
- 关于IEWebControls的安装及一些应用
- (使用ASPJPEG)一、为图片添加水印
- DataGrid数据导入Excel
- 取得一段汉语的每个字的首字母
- raid0,raid1,raid10,raid5,raid50,raid6,raid60的功能总结简述_...
- mtk flash配置
- JavaScript事件绑定的方法说明