高分,求代码 麻烦你们了。有关Datagrid 表中字段链接问题
怎么不才能够将Datagrid 表中点击某一字段显示有关这个字段信息的另一张表
谁有这样类似的例子吗?或有关代码
------解决方案--------------------留个名。。先下班。
------解决方案--------------------那个字段设置为HYPERLINKFIELD类型
DataNavigateUrlFile里面写绑定的值如:sysID
DataNavigateUrlFor里面写连接地址如:admin_admin_ok.aspx?id={0}
------解决方案--------------------这个不就是GridView配合DetailView使用的例子么
------解决方案--------------------靠。我的沙发~!
------解决方案-------------------- <%@ Page Language= "C# " AutoEventWireup= "true " CodeFile= "Default.aspx.cs " Inherits= "_Default " %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN " "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd ">
<html xmlns= "http://www.w3.org/1999/xhtml " validaterequest= "false ">
<head runat= "server ">
<title> 数据控件的使用实例_A-2 </title>
</head>
<body>
<form id= "form1 " runat= "server ">
<center>
<h2>
数据控件的使用实例_B+2 </h2>
<br />
<asp:GridView ID= "gvDataList " runat= "server " Style= "position: static " AutoGenerateColumns= "False " Width= "800px " ValidateRequest= "false " OnSelectedIndexChanged= "gvDataList_SelectedIndexChanged ">
<Columns>
<asp:BoundField DataField= "ID " HeaderText= "ID " >
<ItemStyle Width= "45px " />
</asp:BoundField>
<asp:BoundField DataField= "Name " HeaderText= "姓名 " >
<ItemStyle Width= "100px " />
</asp:BoundField>
<asp:BoundField DataField= "Address " HeaderText= "地址 " >
<ItemStyle Width= "200px " />
</asp:BoundField>
<asp:BoundField DataField= "Memo " HeaderText= "备注 " >
<ItemStyle Width= "200px " />
</asp:BoundField>
<asp:TemplateField HeaderText= "主页 ">
<ItemTemplate>
<asp:HyperLink ID= "HyperLink1 " runat= "server " NavigateUrl= ' <%# Eval( "url ") %> ' Text= "我的主页 "> </asp:HyperLink>
</ItemTemplate>
</asp:TemplateField>
<asp:CommandField HeaderText= "select " ShowSelectButton= "True " />
</Columns>
</asp:GridView>
</center>
<center>
</center>
<center>
<asp:DetailsView ID= "DetailsView1 " runat= "server " AutoGenerateRows= "False " Height= "50px "
Width= "125px ">
<Fields>
<asp:BoundField DataField= "name " HeaderText= "name " />
<asp:BoundField DataField= "address " HeaderText= "address " />