单击“添加”按钮后,对象引用未设置为对象的实例

时间:2014-07-26 03:33:17

标签: c# nullreferenceexception

抛出错误的代码发生在:

protected void btnAddSales_click(object sender,EventArgs e)         {string orderName = Ordername.Text;}

错误:

Error message: Object reference not set to an instance of an object.
   at POL.Website.inventory.AddSales_click(Object sender, EventArgs e) in \\Website\inventory.aspx.cs:line 321
   at System.Web.UI.WebControls.Button.OnClick(EventArgs e)
   at System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument)

出现此错误的可能原因是什么?

0 个答案:

没有答案