I have a parent page ProdView.aspx and two static UserControls, UC1 and UC2. Each UC is in an Ajax accordion pane and the accordion inside an updatepanel.
UC1 has a Gridview footer with couple of textboxes and a link button that fires an Add Row insert procedure. I want to Raise an event that will rebind the UC2 after the row insert in UC1.
First I created the sub delegate and event in UC1:
- Public Delegate Sub MyRefresh(ByVal sender As Object, ByVal e As CommandEventArgs)
- Public Event Refresh_UC1 As MyRefresh
In the same UC1 the Insert procedure that fires the insert and RaiseEvent:
Sub PricingGrid_Insert(ByVal sender As System.Object, ByVal e As EventArgs)
Dim myConn As SqlConnection = New SqlConnection(ConfigurationManager.ConnectionStrings("LocalSqlServer").ConnectionString)
Dim myCom As SqlCommand = New SqlCommand("AddRow", myConn)
myCom.CommandText = "AddRow"
myCom.CommandType = CommandType.StoredProcedure
View Complete Post