I have master page in which I am using modalpopupextender under which there are login form. Now In my client(aspx) page I want to use same Login form from that modalpopupextender. So I tried to get it's control from master page but it's giving me error.
Object reference not set as an instance of an object.
Client Page (Code Behind)
Private Sub orderButton_Click(sender As Object, e As EventArgs) Handles orderButton.Click
Dim mploginM As AjaxControlToolkit.ModalPopupExtender = DirectCast(Page.Master.FindControl("mp0"), AjaxControlToolkit.ModalPopupExtender)
If HttpContext.Current.Request.Cookies("chkusername") Is Nothing Then
There seem to be naming issue when a page with master page. In short, you need to call
FindControl twice - one time for a master page and then for a content page.
Please see this thread for code sample: Find a control on a page with a master page