日期:2014-05-18  浏览次数:20392 次

如何将DataGrid中的绑定列设置为超链接
如何将DataGrid中的绑定列设置为超链接

------解决方案--------------------
<asp:TemplateField HeaderText= "标 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 题 ">
<ItemStyle Font-Bold= "False " Font-Italic= "False " Font-Overline= "False " Font-Strikeout= "False "
Font-Underline= "False " HorizontalAlign= "Left " />
<HeaderStyle Width= "40% " />
<ItemTemplate>
<a href= ' <%# "../FreeState/InfoView.aspx?infoid= "+Eval( "infoid ") %> &returl= <%#HttpUtility.UrlEncode(HttpContext.Current.Request.Url.ToString())%> '>
<%# Eval( "title ")%>
</a>
</ItemTemplate>
</asp:TemplateField>
------解决方案--------------------
<asp:TemplateColumn SortExpression= "NickName " HeaderText= "真实姓名 ">
<ItemTemplate>
<asp:LinkButton ID= "lbtNickName " runat= "server " ToolTip= ' <%# DataBinder.Eval(Container.DataItem, "NickName ")%> '
Text= ' <%# DataBinder.Eval(Container.DataItem, "NickName ")%> ' CommandName= "show ">
</asp:LinkButton>
</ItemTemplate>
</asp:TemplateColumn>
------解决方案--------------------
前面一个是Gridview的,后面是DataGrid的,基本的道理是一样的
------解决方案--------------------
属性生成器 中本生有个超级连接链
------解决方案--------------------
有很多方法 如果是单独的某行超链
http://dev.csdn.net/develop/article/74/74244.shtm
这里面讲的不少