WebForm2.aspx 文件:
<%@ Page Language="vb" AutoEventWireup="false" Codebehind="WebForm2.aspx.vb" Inherits="house.WebForm2"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<title>WebForm2</title>
<meta name="GENERATOR" content="Microsoft Visual Studio .NET 7.1">
<meta name="CODE_LANGUAGE" content="Visual Basic .NET 7.1">
<meta name="vs_defaultClientScript" content="JavaScript">
<meta name="vs_targetSchema" content="http://schemas.microsoft.com/intellisense/ie5">
</HEAD>
<body MS_POSITIONING="GridLayout">
<form id="Form1" method="post" runat="server">
<FONT face="宋体">
<asp:DataGrid id="DataGrid1" style="Z-INDEX: 101; LEFT: 192px; POSITION: absolute; TOP: 16px"
runat="server" Width="560px" Height="590px" ShowFooter="True" AutoGenerateColumns="False"
BorderColor="#336666" BorderStyle="Double" BorderWidth="3px" BackColor="White" CellPadding="4"
GridLines="Horizontal">
<SelectedItemStyle Font-Bold="True" ForeColor="White" BackColor="#339966"></SelectedItemStyle>
<ItemStyle ForeColor="#333333" BackColor="White"></ItemStyle>
<HeaderStyle Font-Bold="True" ForeColor="White" BackColor="#336666"></HeaderStyle>
<FooterStyle ForeColor="#333333" BackColor="White"></FooterStyle>
<Columns>
<asp:TemplateColumn>
<ItemTemplate>
<P>
<asp:TextBox id=TextBox2 runat="server" Height="88px" Text='<% #DataBinder.Eval(Container,"DataItem.name") %>' BorderStyle="None" ReadOnly="True">
</asp:TextBox></P>
<P>
<asp:HyperLink id="HyperLink2" runat="server" NavigateUrl='<% # "show.aspx?name=" & DataBinder.Eval(Container,"DataItem.name") %>' Target="_blank">个人信息</asp:HyperLink></P>
</ItemTemplate>
</asp:TemplateColumn>
</Columns>
<PagerStyle HorizontalAlign="Center" ForeColor="White" BackColor="#336666" Mode="NumericPages"></PagerStyle>
</asp:DataGrid></FONT>
</form>
</body>
</HTML>
上面代码中蓝色背景是关键所在, NavigateUrl='<% # "show.aspx?name=" & DataBinder.Eval(Container,"DataItem.name") %>' 其中show.aspx 是超级链接所指向的页面. name是要传递的
参数名(随便取的),DataItem.name 中的name是被绑定的数据表的字段名.
在show.aspx页面中,获取传递的参数值,OK.
同样,WebForm2.aspx 文件需要 WebForm2.aspx.vb 文件 来进行数据筛选与绑定.同
VB.net技巧之五一样.