Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > need some help with coding

Reply
Thread Tools

need some help with coding

 
 
Milsnips
Guest
Posts: n/a
 
      10-17-2005
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(ConfigurationSet tings.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

---------------------

Any help appreciated,
Paul


 
Reply With Quote
 
 
 
 
Milsnips
Guest
Posts: n/a
 
      10-17-2005
never mind.. problem solved..

"Milsnips" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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(ConfigurationSet tings.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
>
> ---------------------
>
> Any help appreciated,
> Paul
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Need some help fixing some HTML and CSS problems Domino HTML 5 11-05-2006 09:58 PM
general coding issues - coding style... calmar Python 11 02-21-2006 10:36 AM
Need some simple coding help mx2k Python 7 03-03-2005 10:53 AM
Need some help for some perl homework.... Perl 0 02-25-2004 01:45 AM
Re: Coding a c# wrapper class to unmanaged C++ program, need some guidance Brendan Duffy ASP .Net 0 07-25-2003 12:49 AM



Advertisments