Click here to Skip to main content
15,918,617 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi Friends,

am getting error in this code..

CSS
Object reference not set to an instance of an object.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.

Source Error:


<img src="Images/<%Response.Write(Request.QueryString["typ"].ToString()); %>.jpg" width="200px" height="60px" alt=""/>

Please help, Thanks...
Posted

1 solution

Check whether Request.QueryString["typ"] is null before using it.

Or try to handle the null like

Response.Write( Convert.ToString(Request.QueryString["typ"]))
 
Share this answer
 
v2
Comments
HYD Webdeveloper 13-Feb-14 1:37am    
Thank you so much... its working.
JoCodes 13-Feb-14 1:37am    
You are welcome.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900