Groups | Blog | Home
all groups > asp.net > february 2006 >

asp.net : Yikes. A little help here.


James Woody
2/3/2006 6:13:05 PM
I have listed the Orders on my page with a datalist.
Now I need to append the OrderID onto the URL at this point
http://www.microsoft.com/item.asp?orderID

How do I get the OrderID out of the datalist.

Should I use a datalist or a datagrid or a datarepeater or a datadeleter or
a datatweeter or what

Ken Cox - Microsoft MVP
2/3/2006 11:25:56 PM
Hi James,

Are you working in ASP.NET 2.0? If so, you can try this.

Ken
Microsoft MVP [ASP.NET]


<%@ Page Language="VB" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<script runat="server">

Protected Sub Page_Load(ByVal sender As Object, ByVal e As
System.EventArgs)
Dim ws As New hits.rockhits
DataList1.DataSource = ws.GetDataView("artist='Elvis Presley'")
DataList1.DataBind()
End Sub
</script>

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>DataList</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:datalist id="DataList1" runat="server">
<itemtemplate>
<a
href="somewhere.aspx?orderID=<%#eval("id")%>"><%#Eval("title")%>
</a>
</itemtemplate>
</asp:datalist>
</div>
</form>
</body>
</html>



[quoted text, click to view]

James Woody
2/6/2006 10:59:25 AM
thank you

[quoted text, click to view]

AddThis Social Bookmark Button