N
noone
Below are the guts to a function that returns a textbox and button. A
handler is added to the button. All this is done in a class separate from
the code behind including the Handler.
So here is the problem, unless I regenerate the buttons, when I post back
the handler for the button pressed does not fire. What do I need to do to
make this handler work?
Dim p As New PlaceHolder
Dim btn As New ImageButton
Dim txt As New TextBox
txt.Text = "1"
txt.ID = "txt" & Detail.Asin
txt.Width = Unit.Pixel(20) '
txt.EnableViewState = True
btn.CommandArgument = Detail.Asin
btn.ImageUrl = "amzImages/add-to-cart-02.gif"
btn.ID = "btn" & Detail.Asin
btn.EnableViewState = True
AddHandler btn.Click, AddressOf Purchase_AddToCart
p.Controls.Add(btn)
p.Controls.Add(New Web.UI.LiteralControl("<br>Qty: "))
p.Controls.Add(txt)
p.Controls.Add(New Web.UI.LiteralControl(" "))
Return p
x-- 100 Proof News - http://www.100ProofNews.com
x-- 3,500+ Binary NewsGroups, and over 90,000 other groups
x-- Access to over 800 Gigs/Day - $8.95/Month
x-- UNLIMITED DOWNLOAD
handler is added to the button. All this is done in a class separate from
the code behind including the Handler.
So here is the problem, unless I regenerate the buttons, when I post back
the handler for the button pressed does not fire. What do I need to do to
make this handler work?
Dim p As New PlaceHolder
Dim btn As New ImageButton
Dim txt As New TextBox
txt.Text = "1"
txt.ID = "txt" & Detail.Asin
txt.Width = Unit.Pixel(20) '
txt.EnableViewState = True
btn.CommandArgument = Detail.Asin
btn.ImageUrl = "amzImages/add-to-cart-02.gif"
btn.ID = "btn" & Detail.Asin
btn.EnableViewState = True
AddHandler btn.Click, AddressOf Purchase_AddToCart
p.Controls.Add(btn)
p.Controls.Add(New Web.UI.LiteralControl("<br>Qty: "))
p.Controls.Add(txt)
p.Controls.Add(New Web.UI.LiteralControl(" "))
Return p
x-- 100 Proof News - http://www.100ProofNews.com
x-- 3,500+ Binary NewsGroups, and over 90,000 other groups
x-- Access to over 800 Gigs/Day - $8.95/Month
x-- UNLIMITED DOWNLOAD