I want to hide master page table from the content page.
I have tried to hide the table control in different ways but I get following error message on line:
tbl = (HtmlTable)Page.Master.FindControl("tbl_login");
ERROR:
Object reference not set to an instance of an object.
Here is the table control on the master page and the code for hidding master page control from the login page.

There is a page called POView and it has got one link button to Approve PO and it shows POP up window which has got few controls defined one master page(text box and two button in html table) when you hit the button it sends the request to another page called Login which authenticate user password and do some updates in DB and then show the message to this POP up window (response.write).
All i want is to hide the controls (textbox and button defined on master page) from this login page.
NOTE: That Login page doesn’t have any reference tag for the master page.
@ Page Language=”C#” AutoEventWireup=”true” CodeFile=”login.aspx.cs” Inherits=”login” %>
ADDED: Here is the function which is called onClick of Master page button. It is sending request to login page.
function showHint(str, str2, str3, reason)
{
gDiv = 'appFeedback';
xmlHttp=GetXmlHttpObject();
if (xmlHttp==null)
{
alert ("Your browser does not support AJAX!");
return;
}
//replace "tricky" chars in QS
var pwd= str.replace('£','!!pound!!');
pwd= pwd.replace('£','!!pound!!');
pwd= pwd.replace('£','!!pound!!');
pwd= pwd.replace('£','!!pound!!');
pwd= pwd.replace('&','!!and!!');
pwd= pwd.replace('&','!!and!!');
pwd= pwd.replace('&','!!and!!');
pwd= pwd.replace('&','!!and!!');
var url="login.aspx";
url=url+"?q="+pwd;
url=url+"&q2="+str2;
url=url+"&q3="+str3;
url=url+"&reason="+reason;
url=url+"&entity=<%= Request["entity"] %>";
url=url+"&sid="+Math.random();
xmlHttp.onreadystatechange=stateChanged;
xmlHttp.open("GET",url,true);
xmlHttp.send(null);
}
Try To call this javascript After doing the login
window.opener.document.getElementById("tbl_login").style.visibility="hidden";In you code it is given as
Here the “stateChanged” must be a javascript function which will be fired after doing the login.
Inside that function you can write the code to hide.
for more information about the
readystatechangedeventplease look into this :http://www.w3schools.com/ajax/ajax_xmlhttprequest_onreadystatechange.aspReturn success from Loginpage