Hi all,
In Psuedo code this what I'm trying to achieve:
User comes to page with their Customer profile
if user clicks "Address Information"
populate pnlContent with Addresses_usercontrol - dynamic buttons are created in this user control
end if
If user clicks "Change this address" - dynamic button with AddressID
clear pnlContent()
populate pnlContent with EditAddress_usercontrol
end if
First off, on my main page I have a RadSplitter with two panes
I am using the buttons in the pnlButtons to populate a userControl in the pnlContent. This all works fine. However, when a userControl is loaded into pnlContent there are dynamic buttons that are created with addeventhandlers (VB) . Essentially these buttons will clear the userControl in pnlContent and populate with another userControl.
Since I have dynamic buttons being created their click events are not being fired, I figure because postback has already happened. How can i persist the click event for these dynamic buttons in VB?
In Psuedo code this what I'm trying to achieve:
User comes to page with their Customer profile
if user clicks "Address Information"
populate pnlContent with Addresses_usercontrol - dynamic buttons are created in this user control
end if
If user clicks "Change this address" - dynamic button with AddressID
clear pnlContent()
populate pnlContent with EditAddress_usercontrol
end if
First off, on my main page I have a RadSplitter with two panes
<telerik:RadSplitter ID="RadSplitter1" runat="server" Height="100%" Width="100%"> |
<telerik:RadPane ID="LeftPane" runat="server" Width="180px" Height="100%"> |
<asp:Panel runat="server" ID="PnlButtons"> |
<asp:Button runat="server" ID="CusInfo" Text="Customer Information" /> |
<br /> |
<asp:Button runat="server" ID="CusCC" Text="Credit Card Information" /> |
<br /> |
<asp:Button runat="server" ID="CusAddr" Text="Address Information" /> |
<br /> |
<asp:Button runat="server" ID="CusContact" Text="Contact Information" /> |
<br /> |
<asp:Button runat="server" ID="CusContPrefs" Text="Contact Preferences" /> |
<br /> |
<asp:Button runat="server" ID="CusDemo" Text="Demographic Information" /> |
<br /> |
<asp:Button runat="server" ID="CusOrders" Text="Order History" /> |
<br /> |
</asp:Panel> |
</telerik:RadPane> |
<telerik:RadSplitBar ID="RadSplitBar1" runat="server" CollapseMode="None" /> |
<telerik:RadPane ID="MiddlePane" runat="server" Scrolling="None" Width="400px" Height="100%"> |
<telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server" Width="400px" LoadingPanelID="LoadingPanel1"> |
<asp:Panel ID="pnlContent" runat="server"> |
</asp:Panel> |
</telerik:RadAjaxPanel> |
</telerik:RadPane> |
</telerik:RadSplitter> |
I am using the buttons in the pnlButtons to populate a userControl in the pnlContent. This all works fine. However, when a userControl is loaded into pnlContent there are dynamic buttons that are created with addeventhandlers (VB) . Essentially these buttons will clear the userControl in pnlContent and populate with another userControl.
Dim newbtn As New Button() |
newbtn.Text = "Add New!" |
newbtn.ID = "btn" |
AddHandler newbtn.Click, AddressOf DynamicClick |
Since I have dynamic buttons being created their click events are not being fired, I figure because postback has already happened. How can i persist the click event for these dynamic buttons in VB?