[技巧]DataGird的hyper column的url field 绑定两个字段
来源:互联网 发布:大一c语言编程题库 编辑:程序博客网 时间:2024/06/07 08:40
<script type="text/javascript"><!--google_ad_client = "pub-2947489232296736";/* 728x15, 创建于 08-4-23MSDN */google_ad_slot = "3624277373";google_ad_width = 728;google_ad_height = 15;//--></script><script type="text/javascript"src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
//假设第一列为超级链接列
private void DataGrid1_ItemDataBound(object sender, System.Web.UI.WebControls.DataGridItemEventArgs e)
{
string ID = "123";
string Name = "user";
if ( ( e.Item.ItemType != ListItemType.Header ) && ( e.Item.ItemType != ListItemType.Footer ) )
{
e.Item.Cells[0].Text = "<a href=" + ( ( hyperLink ) e.Item.Cells[0].Controls[0] ).Navigateurl + "&ID=" + ID + "&Name=" + Name + ">" + ( ( hyperLink ) e.Item.Cells[0].Controls[0] ).Text + "</a>";
}
}
<script type="text/javascript"><!--google_ad_client = "pub-2947489232296736";/* 728x15, 创建于 08-4-23MSDN */google_ad_slot = "3624277373";google_ad_width = 728;google_ad_height = 15;//--></script><script type="text/javascript"src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
<script type="text/javascript"><!--google_ad_client = "pub-2947489232296736";/* 160x600, 创建于 08-4-23MSDN */google_ad_slot = "4367022601";google_ad_width = 160;google_ad_height = 600;//--></script><script type="text/javascript"src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
在ItemDataBound事件里做//假设第一列为超级链接列
private void DataGrid1_ItemDataBound(object sender, System.Web.UI.WebControls.DataGridItemEventArgs e)
{
string ID = "123";
string Name = "user";
if ( ( e.Item.ItemType != ListItemType.Header ) && ( e.Item.ItemType != ListItemType.Footer ) )
{
e.Item.Cells[0].Text = "<a href=" + ( ( hyperLink ) e.Item.Cells[0].Controls[0] ).Navigateurl + "&ID=" + ID + "&Name=" + Name + ">" + ( ( hyperLink ) e.Item.Cells[0].Controls[0] ).Text + "</a>";
}
}
<script type="text/javascript"><!--google_ad_client = "pub-2947489232296736";/* 728x15, 创建于 08-4-23MSDN */google_ad_slot = "3624277373";google_ad_width = 728;google_ad_height = 15;//--></script><script type="text/javascript"src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
<script type="text/javascript"><!--google_ad_client = "pub-2947489232296736";/* 160x600, 创建于 08-4-23MSDN */google_ad_slot = "4367022601";google_ad_width = 160;google_ad_height = 600;//--></script><script type="text/javascript"src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
- [技巧]DataGird的hyper column的url field 绑定两个字段
- 一个数据库加DataGird的绑定操作
- EasyUI datagird 获取列的title和field
- 通过URL传绑定字段参数的几种方法
- Butter Knife ——Android视图的字段(Field)和方法(Method)绑定
- 给DropDownList的DataTextField属性绑定两个字段
- 给DropDownList的DataTextField属性绑定两个字段
- ArcMap中属性字段计算器(Field Calculator)的使用技巧
- combobox下拉列表控件 关联绑定两个表的技巧
- ComboBox绑定两个字段
- 关于DataGird的几个事件
- 关于datagird 分页的说明
- iPhoneUIText Field组件的文本字段属性
- Solr字段类型field type的定义
- 关于TP字段field的一些理解
- Hibernate下的Unknown column 'student_number' in 'field list'错误
- 出现 Column 'sp_id' in field list is ambiguous 的问题解决
- datalist 的两个绑定
- 用PHP开发GUI
- 我自己写的自定义Web的上传控件
- 用PHP将数据导入到Foxmail
- 两个aspx页面间传递引用对象。
- 基于PHP与XML的PDF文档生成技术
- [技巧]DataGird的hyper column的url field 绑定两个字段
- 无限级别菜单的实现
- 客户端脚本对中文的验证(javascript)
- PHP实现的功能是显示8条基色色带
- 我的asp.net网站开发经验,欢迎参加讨论。
- 一个ORACLE分页程序,挺实用的.
- 笑望人生,关于IHttpHandler处理图片
- php,不用COM,生成excel文件
- HTML在线编辑器--服务器控件~~.NET实现~~