DynamicUserControl

P

prollo

Hi,
have asp.net application with result.aspx page and uc1.ascx(Into
uc1.ascx there's dropdownlist with autopostback).
I include into result.aspx an usercontrol using this function:

Private Sub deserializePage()
Dim usercontrol As Control
usercontrol = LoadControl("UserControl\UC1.ascx")
Dim element As uc1= CType(usercontrol, uc1)
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())
End Sub


Into uc1.ascx I've include this:

Public Event UC1_Combo_Changed(ByVal sender As Object, ByVal e As
System.EventArgs)

Public Sub cmbPage_SelectedIndexChanged(ByVal sender As System.Object,
ByVal e As System.EventArgs) _
Handles cmbPage.SelectedIndexChanged
RaiseEvent UC1_Combo_Changed(sender, e)
Server.Transfer("ok.aspx")
End Sub

If I change an item of dropdownlist the page post back without calling
the events selectIndexChanged.
Can anyone help me please?
 

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,780
Messages
2,569,611
Members
45,276
Latest member
Sawatmakal

Latest Threads

Top