Hello, this is probably simple but I need some help with this situation.
I programatically add a web user control that I created to a placeholder on the click event of a button with the following code:
Protected Sub btnDeleteUsers_Click(ByVal
sender As Object, ByVal e As System.EventArgs) Handles btnDeleteUsers.Click
Dim ctlDeleteUser As Control = LoadControl("~/Controls/Ad
min/Member
ship/Delet
eUser.ascx
")
Me.plControls.Controls.Add
(ctlDelete
User)
End Sub
I'm having the following issues:
1. During the page load of the DeleteUser.ascx I databind a dropdownlist and insert some instructions. BUT, the page load for the control does not fire.
How do you make if fire with out the page load or postback it is expecting?
2. The DeleteUser.ascx also contains a delete button that fires a stored procedure to delete the user selected from the dropdownlist from the database. BUT, this never fires..
How can I make this occur?
Im new to adding and using controls in this way and am sure it has to do with postback, but can't seem to google the answer I need. Any help would be great!
Start Free Trial