Groups | Blog | Home
all groups > asp.net > july 2004 >

asp.net : How to handle dynamically created buttons in ASP.NET using VB.net


anthony
7/22/2004 10:47:56 AM
You may need to recreate the button

Dim objButton as New Button

objButton = Page.FindControl("r" & strMyProductId)

lblStatus.Text = objButton.Text



[quoted text, click to view]

ronaldo
7/22/2004 11:29:10 PM
As title, I used the following code to create a button and assign the event
handle dynamically.

private sub showOrderList()
...
Dim btnRemove As New Button
btnRemove.ID = "r" & strMyProductId
btnRemove.Text = "Remove"
btnRemove.Attributes("style")
="font-family:arial;font-size:8pt"
btnRemove.CausesValidation = False
AddHandler btnRemove.Click, AddressOf removeItem
.......
end sub

However, I found that the function removeItem never been called.
Can you tell me how can I fixed?
I found that most of the solution found in web are in C# and not in VB.net.
Would you tell me whether there are only C# solution?

thank you

AddThis Social Bookmark Button