Reputation: 11
Is it possible to use/reference same ascx user control within the same ascx control? Primarily we want a popup within a popup within a popup - n level based on a condition. The popup is the user control.
Upvotes: 1
Views: 148
Reputation: 29000
You can not : Circular file references are not allowed.
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="WebUserControl1.ascx.cs" Inherits="WebApplication1.WebUserControl1" %>
<%@ Register TagPrefix="test" TagName="test" Src="~/WebUserControl1.ascx"%>
This code is not possible
Upvotes: 0
Reputation: 96606
I guess this is possible when loading/adding the control programmatically, e.g:
this.Controls.Add(LoadControl("~/mycontrol.ascx"));
But if you do this unconditionally, then you'll get an endless loop.
Upvotes: 1