When I try to open the page from my IDE in VS 2008 using "VIEW IN BROWSER" option I get "Object reference not set to an instance of an object" error.
The piece of code I get this error :
XResult = Request.QueryString["res"];
TextBox1.Text = XResult.ToString();
The problem here is that XResult
is null
and when you call ToString
on it the code produces a NullReferenceException
. You need to account for this by doing an explicit null
check
TextBox1.Text = XResult == null ? String.empty : XResult.ToString();