Click here to Skip to main content
11,417,750 members (44,928 online)
Rate this: bad
good
Please Sign up or sign in to vote.
See more: ASP.NET C#4.0
Hi ,

this is my source code

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

this is my code behind

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 19-Dec-12 20:07pm
Edited 19-Dec-12 23:53pm
ProgramFOX150.7K
v4
Comments
AshishChaudha at 20-Dec-12 1:09am
   
have you tried to debug your code??
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

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.
  Permalink  
Comments
Christian Graus at 20-Dec-12 1:37am
   
There is clearly different source on your dev server. Your company is retarded. Run for your life.
Christian Graus at 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.
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

I think, there is no error in button click event. please debug in page load.
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 3

Debug your code, most probably there is something written it your code which is not getting the proper value or its null.
  Permalink  

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

  Print Answers RSS
0 Sascha Lefévre 340
1 Abhinav S 339
2 OriginalGriff 315
3 Sergey Alexandrovich Kryukov 245
4 deepankarbhatnagar 121
0 Sergey Alexandrovich Kryukov 9,345
1 OriginalGriff 7,712
2 Maciej Los 3,758
3 Abhinav S 3,601
4 Sascha Lefévre 3,198


Advertise | Privacy | Mobile
Web01 | 2.8.150427.4 | Last Updated 20 Dec 2012
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100