Scenario: I have a nested web user controls in my asp web page, and I have a button inside the child user control.
Web Page: references a parent control called “slot” which dynamically loads
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Home.aspx.cs"
Inherits="light.Home" %>
<%@ Reference Control="~/UserControl/Slot.ascx" %>
Parent User Control: references a child control called “ray” which also dynamically loads
<%@ Control Language="C#" AutoEventWireup="true" CodeFile="Slot.ascx.cs"
Inherits="light.Slot" %>
<%@ Reference Control="~/UserControl/Ray.ascx" %>
Child User Control: has a button called “ButtonRay” which i want it to run on its click event.
<%@ Control Language="C#" AutoEventWireup="true" CodeFile="Ray.ascx.cs"
Inherits="light.Ray" %>
<div id="AddRay" runat="server">
<asp:Button ID="ButtonRay" runat="server" Text="Ray"
onclick="ButtonRay_Click"/>
</div>
Problem: The button does not fire its click event (ButtonRay_Click) from the server side
protected void ButtonComment_Click(object sender, EventArgs e)
{
// this the code that i want to be executed
}