WebForm
aspx 文件
<%@ Page Language=
vb
AutoEventWireup=
false
Codebehind=
WebForm
aspx
vb
Inherits=
house
WebForm
%>
<!DOCTYPE HTML PUBLIC
//W
C//DTD HTML
Transitional//EN
>
<HTML>
<HEAD>
<title>WebForm
</title>
<meta name=
GENERATOR
content=
Microsoft Visual Studio
NET
>
<meta name=
CODE_LANGUAGE
content=
Visual Basic
NET
>
<meta name=
vs_defaultClientScript
content=
JavaScript
>
<meta name=
vs_targetSchema
content=
>
</HEAD>
<body MS_POSITIONING=
GridLayout
>
<form id=
Form
method=
post
runat=
server
>
<FONT face=
宋體
>
<asp:DataGrid id=
DataGrid
runat=
server
Width=
px
Height=
px
ShowFooter=
True
AutoGenerateColumns=
False
BorderColor=
#
BorderStyle=
Double
BorderWidth=
px
BackColor=
White
CellPadding=
GridLines=
Horizontal
>
<SelectedItemStyle Font
Bold=
True
ForeColor=
White
BackColor=
#
></SelectedItemStyle>
<ItemStyle ForeColor=
#
BackColor=
White
></ItemStyle>
<HeaderStyle Font
Bold=
True
ForeColor=
White
BackColor=
#
></HeaderStyle>
<FooterStyle ForeColor=
#
BackColor=
White
></FooterStyle>
<Columns>
<asp:TemplateColumn>
<ItemTemplate>
<P>
<asp:TextBox id=TextBox
runat=
server
Height=
px
Text=
<% #DataBinder
Eval(Container
DataItem
name
) %>
BorderStyle=
None
ReadOnly=
True
>
</asp:TextBox></P>
<P>
<asp:HyperLink id=
HyperLink
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=
#
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
同樣
WebForm
aspx 文件需要 WebForm
aspx
vb 文件 來進行數據篩選與綁定
From:http://tw.wingwit.com/Article/program/net/201311/12386.html