Hello
I have tried it behind the master page and it's working fine see the below code as per your requirements
using System.IO;
public partial class SiteMaster : System.Web.UI.MasterPage
{
protected void Page_Load(object sender, EventArgs e)
{
string url = Path.GetFileName(Request.Url.AbsolutePath);
if (url == "Childpage.aspx")
{
divId.Visible = true;
}
}
}