gridview超链接列链接方法
来源:互联网 发布:java编程艺术 编辑:程序博客网 时间:2024/05/30 05:07
<asp:GridView ID="grdSent" runat="server" AllowPaging="True" AutoGenerateColumns="False" OnPageIndexChanging="grdSent_PageIndexChanging">
<Columns>
<asp:CommandField ShowDeleteButton="True" />
<asp:BoundField DataField="uniqueID" HeaderText="uniqueID" Visible="False" />
<asp:HyperLinkField DataNavigateUrlFields="uniqueID" DataNavigateUrlFormatString="~/BBS/fckeditor.aspx?fck={0}" DataTextField="subject" HeaderText="主题" />
<asp:BoundField DataField="mailFrom" HeaderText="发件人" />
<asp:BoundField DataField="sendTime" HeaderText="发送时间" />
</Columns>
</asp:GridView>
<Columns>
<asp:CommandField ShowDeleteButton="True" />
<asp:BoundField DataField="uniqueID" HeaderText="uniqueID" Visible="False" />
<asp:HyperLinkField DataNavigateUrlFields="uniqueID" DataNavigateUrlFormatString="~/BBS/fckeditor.aspx?fck={0}" DataTextField="subject" HeaderText="主题" />
<asp:BoundField DataField="mailFrom" HeaderText="发件人" />
<asp:BoundField DataField="sendTime" HeaderText="发送时间" />
</Columns>
</asp:GridView>
带多个参数:
<asp:HyperLinkField DataNavigateUrlFields="parentid,id" Text="下级目录" DataNavigateUrlFormatString="productchildren.aspx?pid={0}&id={1}" HeaderText="查看下级目录" />
另一种后台编写方法:
<asp:TemplateField HeaderText="表单名称">
<ItemTemplate>
<asp:HyperLink ID="HyperLink1" runat="server" Text='<%# Eval("FORM_NAME") %>'></asp:HyperLink>
</ItemTemplate>
</asp:TemplateField>
<ItemTemplate>
<asp:HyperLink ID="HyperLink1" runat="server" Text='<%# Eval("FORM_NAME") %>'></asp:HyperLink>
</ItemTemplate>
</asp:TemplateField>
protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
{
//在不可见之前做很多事情~ ~~~
if (e.Row.RowType == DataControlRowType.DataRow)
{
//链接~
((HyperLink)e.Row.Cells[1].FindControl("HyperLink1")).NavigateUrl = string.Format("javascript:void window.open('http://DTSFLOWER/module/mailroute.aspx?FORM_KIND={0}&FORM_NO={1}&FORM_APPROVE_ID={2}&LOGON_ID={3}&MAIL_TYPE={4}');",
e.Row.Cells[2].Text,e.Row.Cells[0].Text ,e.Row.Cells[3].Text,e.Row.Cells[4].Text,e.Row.Cells[5].Text );
//小提示~
e.Row.Cells[1].ToolTip = "表单号:" + e.Row.Cells[0].Text;
//VISIBLE=FALSE~~~
for (int i = 0; i < e.Row.Cells.Count; i++)
{
if (i != 1)
{
e.Row.Cells[i].Visible = false;
}
}
}
{
//在不可见之前做很多事情~ ~~~
if (e.Row.RowType == DataControlRowType.DataRow)
{
//链接~
((HyperLink)e.Row.Cells[1].FindControl("HyperLink1")).NavigateUrl = string.Format("javascript:void window.open('http://DTSFLOWER/module/mailroute.aspx?FORM_KIND={0}&FORM_NO={1}&FORM_APPROVE_ID={2}&LOGON_ID={3}&MAIL_TYPE={4}');",
e.Row.Cells[2].Text,e.Row.Cells[0].Text ,e.Row.Cells[3].Text,e.Row.Cells[4].Text,e.Row.Cells[5].Text );
//小提示~
e.Row.Cells[1].ToolTip = "表单号:" + e.Row.Cells[0].Text;
//VISIBLE=FALSE~~~
for (int i = 0; i < e.Row.Cells.Count; i++)
{
if (i != 1)
{
e.Row.Cells[i].Visible = false;
}
}
}
}
- gridview超链接列链接方法
- gridview超链接列链接方法 (转)
- gridview 有链接列
- GridView绑定超链接列加title属性
- GridView 列中的超链接,带页面间的值传递方法。格式化类的。
- GridView超链接字段的URL编码方法
- gridview中利用隐藏列值实现超链接
- GridView超链接
- GridView超链接
- 使用JS为GridView列设置链接
- gridview隐藏列的方法
- GridView隐藏列的方法
- Gridview固定列的方法
- GridView动态生成列方法
- GridView实现超链接列和图片列,跳转页面并传递参数
- GridView中固定列的方法
- gridview列内容自动换行的方法
- gridview隐藏列的几种方法
- sql 解释带分割符的字符串
- 个人常用word技巧----平时编辑word能快不少~
- VNI-2015 : 目标节点的节点首选身份证明无效
- Scrum 开发模式失败案例总结(待续)
- JFreeChart 一个曲线的实例
- gridview超链接列链接方法
- php mysql wap 新闻管理网站
- Jfreechart的研究学习
- web 應用 日曆 tips
- JFreeChart简单介绍及入门实例 - [JAVA编程]
- jfreechart例子
- contains和compareDocumentPosition 方法来确定是否HTML节点间的关系
- 浅谈Java的System.out.print与System.out.println的区别
- 心中心法的十种行愿