Yikes. A little help here.

J

James Woody

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
 
K

Ken Cox - Microsoft MVP

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>
 
J

James Woody

thank you

Ken Cox - Microsoft MVP said:
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>



James Woody said:
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,020
Latest member
GenesisGai

Latest Threads

Top