Get the current file being processed in ASP.net-Collection of common programming errors

Request.AppRelativeCurrentExecutionFilePath should do what you need. Is it producing unexpected results?

Update

You should be able to retrieve any UserControl(s) currently being executed by enumerating the Controls collection of the current page handler. Assuming an external context, here’s an example that should work:

public static string[] GetCurrentUserControlPaths() {
    if(HttpContext.Current == null) return new string[0];
    if(!(HttpContext.Current.Handler is Page)) return new string[0];

    var page = (HttpContext.Current.Handler as Page);
    var paths = ControlAggregator(page, c => c is UserControl).Cast().Select(uc => uc.AppRelativeVirtualPath);

    if(page.Master != null) {
        paths.Concat(ControlAggregator(page.Master, c => c is UserControl).Cast().Select(uc => uc.AppRelativeVirtualPath));
    }

    return paths.ToArray();
}

public static Control[] ControlAggregator(this Control control, Func selector) {
    var list = new List();

    if (selector(control)) {
        list.Add(control);
    }

    foreach(Control child in control.Controls) {
        list.AddRange(ControlAggregator(child, selector));
    }

    return list.ToArray();
}