C#中出现“未将对象引用设置到对象的实例”错误
protectedvoidPage_Load(objectsender,EventArgse){Printbtn.Click+=newEventHandler(btnPr...
protected void Page_Load(object sender, EventArgs e)
{
Printbtn.Click += new EventHandler(btnPrintbtn_Click);
string orderIds = Request["orderIds"].Trim(',');
if (string.IsNullOrEmpty(Request["orderIds"]))
{
return;
}
.........
void btnPrintbtn_Click (object sender, EventArgs e)
{
// printdata();
//打印成功后数据处理
string[] orderIds = UpdateOrderIds.Split(',');
if (!String.IsNullOrEmpty(UpdateOrderIds))
{
OrderHelper.SetOrderShipNumber(orderIds, mailNo, templateName);
OrderHelper.SetOrderPrinted(orderIds, true);
}
else
{
ShowMsg("订单当前状态不能打印!", false);
return;
}
} 展开
{
Printbtn.Click += new EventHandler(btnPrintbtn_Click);
string orderIds = Request["orderIds"].Trim(',');
if (string.IsNullOrEmpty(Request["orderIds"]))
{
return;
}
.........
void btnPrintbtn_Click (object sender, EventArgs e)
{
// printdata();
//打印成功后数据处理
string[] orderIds = UpdateOrderIds.Split(',');
if (!String.IsNullOrEmpty(UpdateOrderIds))
{
OrderHelper.SetOrderShipNumber(orderIds, mailNo, templateName);
OrderHelper.SetOrderPrinted(orderIds, true);
}
else
{
ShowMsg("订单当前状态不能打印!", false);
return;
}
} 展开
2个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询