<html>
<head>
<title>GridView HyperLinkField Example</title>
<link rel="stylesheet" href="/shared/netdemos.css">
</head>
<body>
<!-- #include virtual="~/shared/top.inc" -->
<div class="header"><h2>GridView <span class="hilite">HyperLinkField</span> Example</h2></div>
<hr size=1 width=92%>
<div align="center">
<form runat="server">
<asp:gridview id="titlesGrid" runat="server"
datasourceid="titles"
width=90% cellpadding=5 font-size="9pt"
autogeneratecolumns=false
headerstyle-backcolor="maroon"
headerstyle-forecolor="khaki"
headerstyle-font-bold
rowstyle-verticalalign="top">
<columns>
<asp:hyperlinkfield headertext="Title"
datatextfield="title"
datanavigateurlformatstring="title_details.aspx?titleid={0}"
datanavigateurlfields="title_id" />
<asp:boundfield headertext="Title ID"
datafield="title_id" />
<asp:boundfield headertext="Category"
datafield="type" />
<asp:boundfield headertext="Pub ID"
datafield="pub_id" />
<asp:boundfield headertext="Price"
datafield="price"
htmlencode=false
dataformatstring="{0:n2}"
itemstyle-horizontalalign="right" />
</columns>
</asp:gridview>
<asp:sqldatasource id="titles" runat="server"
selectcommand="SELECT * FROM Titles"
datasourcemode="datareader"
connectionstring="<%$ ConnectionStrings:aspnet %>" />
</form>
</div>
<hr size=1 width=92%>
<!-- #include virtual="~/shared/viewsrc.inc" -->
</body>
</html>