ASP.NET – check the current page type (from user control)

public partial class legend : System.Web.UI.UserControl{    protected void Page_Load(object sender, EventArgs e)    {        if (this.Page.GetType().BaseType == typeof(SomeNameSpace.SomePage))        {            Response.Write("SomePage");        }    }}

Leave a Reply

Your email address will not be published. Required fields are marked *