Button Event into dynamic UserControl

L

Luca

I've a DYNAMIC usercontrol with a button...if i click i have only a
submit of the page without passing into Button1_Click function Why???

The usercontrol it's created into a webForm (Default.aspx) that call
the following function...

Private Sub BindBloccoDettaglio()
dim sVar
Dim usercontrol As Control
usercontrol = LoadControl("Blocco_Dettaglio_Hotel.ascx")
Dim element As Dettaglio = CType(usercontrol,
Blocco_Dettaglio)
element.MyVar = sVar
element.DataBind()
Controls.Add(element)
Dim w As StringWriter = New StringWriter
Dim sOutput As HtmlTextWriter = New HtmlTextWriter(w)
element.RenderControl(sOutput)
Me.Response.Write(w.GetStringBuilder().ToString())
Response.Flush()
End Sub
 

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

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,994
Messages
2,570,223
Members
46,812
Latest member
GracielaWa

Latest Threads

Top