need some help with coding

M

Milsnips

hi,

i've created a page, with a datalist that gets a list of ProductID;s from a
product table in my database...

Within the DataList, i have a usercontrol called "ProductDetail.ascx, which
i put in the <ItemTemplate>. This ascx behind-code, has a public called
PRODUCT which i want to pass the ProductID from the datalist to the ASCX,
but im not sure how to reference it here...

---------------------
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load

If Session.Item("client") Is Nothing Then
Response.Redirect("../client/login.aspx?url=newProducts.aspx")

If Not Page.IsPostBack Then

Dim sql As String = "select top 3 stockID from STOCK"

Dim dr As SqlClient.SqlDataReader =
SQLHelper.SqlHelper.ExecuteReader(ConfigurationSettings.AppSettings("storeDB"),
CommandType.Text, sql)

productSpecials.DataSource = dr

productSpecials.DataBind()

End If

End Sub

Private Sub productSpecials_ItemDataBound(ByVal sender As Object, ByVal e As
System.Web.UI.WebControls.DataListItemEventArgs) Handles
productSpecials.ItemDataBound

If Not e.Item Is Nothing Then

Dim dr As System.Data.Common.DbDataRecord = CType(e.Item.DataItem,
System.Data.Common.DbDataRecord)
'''here i dont know how to reference the user control, so i can set it the
PRODUCT variable...????

End If

End Sub
 

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

No members online now.

Forum statistics

Threads
473,754
Messages
2,569,527
Members
44,998
Latest member
MarissaEub

Latest Threads

Top