Null Reference Exception is thrown sometimes
<pre><code>&lt;script language="javascript"&gt;
    res = "&amp;res="+screen.width+"x"+screen.height+"&amp;d="+screen.colorDepth
        top.location.href="Login.aspx?action=set"+res
    &lt;/script&gt;
Source Error:
An unhandled exception was generated during the execution of the current web request,Information regarding origin and location exception can be identified using the exception stact trace below.

Stack trace:

[Null ReferenceException: object reference not set to an instance of an object.]
page_Load(object sender EventArgs e)+143
and next from System.Web
</code></pre>

<p>Based on screen resolution iam setting a login web page.  How do I avoid null reference exception?</p>
