I have a button on a web control page(.ascx) that I need to disable from an aspx page (depending on certain criteria). I just need to know how to call that control(the button) that is on the .ascx page, from my aspx page (in the page load event for example).
I think I have to use the 'FindControl()' function but I am not sure. Thank you for any help!
Loading
Jignesh TrivediPosted Feb 12, 2013, 11:09 PM
hi,
you may use find control method to find out buttoncontrol with in usercontrol
var mybtn = userCntrl.FindControl("btnTest") as Button;
if(mybtn !=null)
{
mybtn.Enabled = false;
}
hope this will help you.