abc.aspx is my page and in my site menu navigation I have categories like "apple", banana" etc. While clicking the categories in the menu I'm appending the categories as query string in the URL like below
http://www.example.com/abc/abc.aspx?filter=apple
Page works fine when user clicks the menu and loads this page. However, if we load this URL separately in new tab/new window it throws "Object reference not set to instance" error. This issue is not reproduced in local.
string filter = Request.QueryString["filter"];
Data[] dt_Data = Search.GetResults(filter);
This code just pass the query string value to GetResults method and returns array of Data objects which i bind to the page. Please note that the code is working fine while navigating via Menu. If the page is loaded in a new tab/new window then only I'm getting error. So here code implementation doesn't seem to have any issue.
Search
– Bob Vale Jun 15 at 8:05