Click here to Skip to main content
15,885,366 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi ,

this is my source code

ASP
<asp:LinkButton ID="btninsert" runat="server" onclick="btninsert_Click">
                Insert Data</asp:LinkButton>


this is my code behind

C#
protected void btninsert_Click(object sender, EventArgs e)
{
}


when i click on insert link button i'm getting the error "object reference not set to an instance of an object ". As per my knowledge this error causes when there is no data whatever we pass the parameters and when there is no data in a datatable in that cases i'm facing this type of problems in previously.

But i'm simplly calling the insert click event there is no data in that , why it's showing this error can any one tell me the reasons to get this error.

and help me how to overcome this issue now...


Thanks in Advance.....
Posted
Updated 19-Dec-12 22:53pm
v4
Comments
AshishChaudha 20-Dec-12 1:09am    
have you tried to debug your code??
[no name] 20-Dec-12 1:11am    
no yar it's not possible to debug in my project that's the reason i ask in this site. why bcz that is pre built there no option to debug my code at any case

If it's not possible to debug, you also can't change the code, so there's no point asking here. How do you know what the code behind is, if you can't debug ? Clearly it's not what you posted, you can't get an error without running code.
 
Share this answer
 
Comments
[no name] 20-Dec-12 1:36am    
we can't debug directly we just copy the source code and .aspx file in to my developer server directly we check on there it self . we can't check on put a break point and see each and every line it's not possible in my company.
and one more thing i don't write any thing in my link button that is empty.
Christian Graus 20-Dec-12 1:37am    
There is clearly different source on your dev server. Your company is retarded. Run for your life.
[no name] 20-Dec-12 1:41am    
we can't do any thing for this but i want to submit my reports that's my job now..
so what i'm asking is what are the reason's to get this type of error's previously i'm getting this error in some different case and i can easily over come at that time but in my linkbutton click event is empty then also it's showing that error why...?
Christian Graus 20-Dec-12 2:03am    
It's not empty, unless the error is being thrown by page load or page prerender. Either way, we can't tell you the reason, based on what you posted.
[no name] 20-Dec-12 2:06am    
k thank u i will check out my page load event again i face any problem means i will contact you with your permission
I think, there is no error in button click event. please debug in page load.
 
Share this answer
 
Debug your code, most probably there is something written it your code which is not getting the proper value or its null.
 
Share this answer
 

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

  Print Answers RSS
Top Experts
Last 24hrsThis month


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