Hi,
I have button on a page, which when clicks gives this error message:
Object reference not set to an instance of an object
It is meant to response.redirect to a new page:
protected void Button2_Click(object sender, EventArgs e)
{
Int32 ProductId = Convert.ToInt32(Request.QueryString["proID"]);
bool result = Executeupdateclickedin(ProductId);
result = Executedeleteshipping(ProductId);
result = Executemassmail2(ProductId);
result = Executeupdatenumberclickedin(ProductId);
Response.Redirect("~/Buyers/defaultedbuyer.aspx?proID=productID");
}
Thanks if someone can help!
Jon
What could be causing this?
Thanks for any help,
Jon
Hi there
To me, it sounds like it doesn't have the value that it is expecting.
Have you debugged and checked that your variables contain values?
Are your queries and methods returning the correct values?
Did you debug it?
Did you see if productid is not coming to null
Hi
I have debugged it - it doesnt show anything up. productid isn't coming null.
Here is the stack trace -
[NullReferenceException: Object reference not set to an instance of an object.]I bolded a line - does that mean the problem is with the updateclickedin section?
Sellers_managelisting.Executeupdateclickedin(Int32 ProductId) +143
Sellers_managelisting.Button2_Click(Object sender, EventArgs e) +114
System.Web.UI.WebControls.Button.OnClick(EventArgs e) +75
System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +97
System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +7
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +11
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +33
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +4886
Thanks,
Jon
sure the problem looks in that section itself...
Got it!
0 comments:
Post a Comment