0

I have a Visual Basic Project where I have a page(Parent.aspx) with a user control inside(ChildForm.ascx), the user control have a checkboxlist where if the selection is changed I cause a postback and send an event

Protected Sub checkBoxList_checked(ByVal sender As Object, ByVal e As EventArgs) Handles checkBoxList.SelectedIndexChanged
    RaiseEvent MyEvent(sender, e)
End Sub

to make a button invisible on the Parent view

    Protected Sub ChildForm_MyEvent(ByVal sender As Object, ByVal e As EventArgs) Handles ChildForm.MyEvent

        If condition Then
            btnSave.Visible = False
        Else
            btnSave.Visible= True
        End If

End Sub

When I debug I see the breakpoint hitting all the lines of code and the condition apply as intended, but the button is not hidden, I dont know why if is setting the correct value it never refreshes the Parent page to show the changes, even if it does cause a postback.

Please help

Julissa DC
  • 251
  • 3
  • 14

1 Answers1

0

Check your page load events (load, prerender, prerenderComplete) to make sure you are not setting the visibility property in there. if you are, you may need to use "If not IsPostBack"

Dharman
  • 30,962
  • 25
  • 85
  • 135
zas1220
  • 11
  • 1