Dismiss
Announcing Stack Overflow Documentation

We started with Q&A. Technical documentation is next, and we need your help.

Whether you're a beginner or an experienced developer, you can contribute.

Sign up and start helping → Learn more about Documentation →

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.

share|improve this question
3  
Please show some code. – Leopard Jun 15 at 7:27
    
What is Search – Bob Vale Jun 15 at 8:05
up vote 0 down vote accepted

The problem is, I have logs in which the UrlReferrer is captured something like below

Uri myReferrer = Request.UrlReferrer;
UrlRefer = myReferrer.ToString();

When I click the Category from Menu then URL refer is www.example.com. But when I load the page in a seperate window/tab this UrlReferrer becomes null which is thrown as error.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.