I'm using ASP.Net to create a WebForm.
In my Page_Load(), I want to test for IsPostBack and capture parameters if any. Here's what I do.
string lcKey;
if (Page.IsPostBack)
{
lcKey = Request.QueryString["myKey"];
}
However, if Page.IsPostBack = True and there were not any parameters passed, I get this error:
Object reference not set to an instance of an object.
If I have a Request.QueryString["myKey"];, do I have to pass parameters? Or, how can I test for parameters being passed?
Thanks,
Jerry