Click here to Skip to main content
15,908,776 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I'm trying to add data into file on web in my site but I get this error:
Stack Trace: 


[NullReferenceException: Object reference not set to an instance of an object.]
   WebApplication1.addnews.Button3_Click(Object sender, EventArgs e) in C:\Users\MONZER\Desktop\Karary Web Site\WebApplication1\addnews.aspx.vb:30
   System.Web.UI.WebControls.Button.OnClick(EventArgs e) +9815014
   System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +204
   System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +12
   System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +15
   System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +35
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1639


What I have tried:

re-upload the site and the file !
Posted
Updated 4-Aug-18 8:20am
Comments
F-ES Sitecore 4-Aug-18 13:42pm    
There is something wrong with your code then.

1 solution

So, this is where YOU have to use the debugger to find out what is null, find out why, and fix it.

You're trying to get/set a property value or execute a method on an object that doesn't exist.

The exception was thrown in your Button3_Click event handler, so...

We can't do that for you. We can't run your code (and don't want to) and we don't have your data to run this code against.

This is one of the easiest errors to trace back to it's source. So run the code under the debugger and do digging.
 
Share this answer
 
v2

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