need some help with coding

Discussion in 'ASP .Net' started by Milsnips, Oct 17, 2005.

  1. Milsnips

    Milsnips Guest


    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

    If Not Page.IsPostBack Then

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

    Dim dr As SqlClient.SqlDataReader =
    CommandType.Text, sql)

    productSpecials.DataSource = dr


    End If

    End Sub

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

    If Not e.Item Is Nothing Then

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

    End If

    End Sub
    Milsnips, Oct 17, 2005
    1. Advertisements

  2. Milsnips

    Milsnips Guest

    never mind.. problem solved..
    Milsnips, Oct 17, 2005
    1. Advertisements

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 (here). After that, you can post your question and our members will help you out.