C# GridView点击某列打开新浏览器窗口
C# GridView点击某列打开新窗口的方式:
(1)打开浏览器新窗口:蓝色部分 通过超链接。
(2)打开模式化窗口:通过OnRowCommand事件,弹出模式化窗口。
具体如下:
<asp:GridView ID="gvAssess" runat="server" AutoGenerateColumns="False" SkinID="gridview"
OnRowCommand="gvAssess_RowCommand" CssClass="maingrid_text" OnRowCreated="gvAssess_RowCreated">
<HeaderStyle HorizontalAlign="Center" />
<RowStyle HorizontalAlign="Center" />
<Columns>
<asp:BoundField DataField="PBHD_ID" HeaderText="评价活动编号" />
<asp:BoundField DataField="HD_NAME" HeaderText="活动名称" />
<asp:TemplateField HeaderText="编辑">
<ItemTemplate>
<asp:LinkButton ID="lnkbtnDelete" runat="server" CommandArgument='<%# Eval("PBHD_ID") %>'
CommandName="Edt" >编辑</asp:LinkButton>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="计算分数">
<ItemTemplate>
<asp:LinkButton ID="lnkbtnScore" runat="server" CommandArgument='<%#Eval("PBHD_ID") %>'
CommandName="Score">计算分数</asp:LinkButton>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="打分">
<ItemTemplate>
<%--C# GridView点击某列打开新浏览器窗口 传多个参数 --%>
<a href="Grade.aspx?PBHD_ID=<%#Eval("PBHD_ID") %>" target="_blank">打分</a>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="查看">
<ItemTemplate>
<%-- C# GridView点击某列打开新浏览器窗口 传多个参数 --%>
<a href="Top.aspx?type=<%#Eval("ZB_TYPE") %>&pbhd=<%#Eval("PBHD_ID") %>" target="_blank">查看</a>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
====后台弹出窗口:
//gridview数据按钮操作事件
protected void gvAssess_RowCommand(object sender, GridViewCommandEventArgs e)
{
//编辑 传活动类型、ID、编辑
if (e.CommandName == "Edt")
{
ScriptManager.RegisterStartupScript(this.Page, typeof(string), "", "<script>var result;result = window.showModalDialog('AddAssessExercise.aspx?TYPE_ADD=Edt&TYPE=" + Server.UrlEncode(ViewState["TYPE"].ToString()) + "&PBHD_ID=" + Server.UrlEncode(e.CommandArgument.ToString()) + "','','dialogHeight:480px; dialogWidth:800px; dialogColor:red;status:no');if(result == '1' ) {document.getElementById( 'btnPackAgeF').click();}</script>", false);
return;
}
}
C# GridView点击某列打开新浏览器窗口的更多相关文章
- 按钮点击事件,打开新的Activity
按钮点击事件,打开新Activity, 打开网页 findViewById(R.id.btnStartBAty).setOnClickListener(new View.OnClickListener ...
- 在Chrome浏览器中点击链接,打开IE浏览器,跳转到指定页面并传递参数
需求: 在Chrome浏览器中点击链接,打开IE浏览器,跳转到指定页面并传递参数 过程: 一些应用软件可以通过点击URL链接启动并执行操作(例如迅雷),这是如何做到的呢? 主要是通过修改注册表,注册U ...
- JavaScript中点击按钮弹出新的浏览器窗口
*/ * Copyright (c) 2016,烟台大学计算机与控制工程学院 * All rights reserved. * 文件名:text.js * 作者:常轩 * 微信公众号:Worldhel ...
- 运行vs时打开一个浏览器窗口,而不是在原有窗口上打开一个标签
1.运行vs时打开一个浏览器窗口,而不是在原有窗口上打开一个标签,结束调试时窗口又关闭了,特别麻烦. 在用swagger调试接口时,好不容易输入了测试数据,然而窗口关闭了,再次调试又得重新输入. 解决 ...
- JS打开新的窗口
一.使用JS打开新窗口 1. 超链接<a href="http://www.wumz.me" title="Mauger`s Blog">Welco ...
- 解决Selenium Webdriver执行测试时,每个测试方法都打开一个浏览器窗口的问题
虽然把WebDriver定义为一个静态变量了,但是每次执行测试都要打开多个窗口,挺浪费时间的. 找了很多中方法,比如使用setUpClass, BeforeSuite都没有完全解决问题.后来无意间发现 ...
- python selenium 多个页面对象类使用同一个webdriver(即只打开一个浏览器窗口)
1 class BasePage(): 2 """selenium基类""" 3 4 def __init__(self, driver=N ...
- selenium自动化测试打开新标签窗口
做项目自动化测试时遇到这个问题:先打开一个页面需要在现有打开浏览器的基础上新开一个标签页输入网址, 在网上查了很多无果,后来发现了内嵌js代码,让js代码实现的方式.谁有其他方法的可以共享一下 方法如 ...
- selenium只打开一个浏览器窗口
from selenium.webdriver import Remote from selenium.webdriver.chrome import options from selenium.co ...
随机推荐
- BZOJ 1854 游戏
Description lxhgww最近迷上了一款游戏,在游戏里,他拥有很多的装备,每种装备都有\(2\)个属性,这些属性的值用\([1,10000]\)之间的数表示.当他使用某种装备时,他只能使用该 ...
- indexedDB article
http://www.html5china.com/HTML5features/LocalStorage/20110926_2022.html http://www.cnblogs.com/haner ...
- How to Setup Chroot SFTP in Linux (Allow Only SFTP, not SSH)
1. Create a New Group Create a group called sftpusers. Only users who belong to this group will be a ...
- 【HDOJ】2966 In case of failure
KD树,这东西其实在ML经常被使用,不过30s的时限还是第一次见. /* 2966 */ #include <iostream> #include <string> #incl ...
- QQ游戏百万人同时在线服务器架构实现
转载自:http://morton5555.blog.163.com/blog/static/976407162012013112545710/# QQ游戏于前几日终于突破了百万人同时在线的关口,向着 ...
- TCP/IP FTP/TFTP
引言 从一台计算机向另一台计算机传送文件是在连网或互联网环境中最常见的任务.而FTP和TFTP就是这样的协议. 关于文件传输协议FTP? 端口21使用服务TCP [FTP模型] FTP连接? 1.控制 ...
- jQuery zxxbox弹出框插件(v3.0)
插件地址: http://www.zhangxinxu.com/study/201009/jquery-zxxbox-v3-demo.html
- 转 -- MVC+EF easyui dataGrid 动态加载分页表格
首先上javascript的代码 <script type="text/javascript"> $(function () { LoadGrid(); }) //加载 ...
- (转载)PHP isset()函数作用
(转载)http://www.cnblogs.com/neve/archive/2011/03/21/1990165.html isset函数是检测变量是否设置. 格式:bool isset ( mi ...
- Frontend Development
原文链接: https://github.com/dypsilon/frontend-dev-bookmarks Frontend Development Looking for something ...