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