Define a specific event for that control. Let you have a user control TestUserControl.ascx having dropdownlist as uxDemoList allow AutoPostBack="true" for uxDemoList control. In code behind your code can be stated bellow.
public delegate void SelectedIndexChangedHandler(object sender, EventArgs e);
public event SelectedIndexChangedHandler SelectedIndexChanged;
protected void uxDemoList_SelectedIndexChanged(object sender, EventArgs e)
{
if (SelectedIndexChanged != null)
{
SelectedIndexChanged(sender, e);
}
Response.Write("<br />In User Control.");
}
Now add this control in aspx page say TestPage.aspx as shown below.
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="TestPage.aspx.cs" Inherits="TestPage" %>
<%@ Register Src="~/TestUserControl.ascx" TagPrefix="uc" TagName="List" %>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
<uc:list id="uxUcList" runat="server" onselectedindexchanged="uxUcList_SelectedIndexChanged" />
</div>
</form>
</body>
</html>
Its code behind will be.
protected void uxUcList_SelectedIndexChanged(object sender, EventArgs e)
{
Response.Write("<br />In Page.");
}
Try this demo it will be clear when using it.