Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Jump Start: Web Forms Application - C#, Step 17
Message
From
26/09/2006 14:47:32
 
 
To
All
General information
Forum:
ASP.NET
Category:
The Mere Mortals .NET Framework
Title:
Jump Start: Web Forms Application - C#, Step 17
Miscellaneous
Thread ID:
01157320
Message ID:
01157320
Views:
56
Regarding Step 17: Adding Items to the Order Detail GridView

This does not work:

In the Page_Load method, change the following code:

Session["dsOrderDetail"] = this.oOrderDetail.GetOrderDetail(this.OrderID);
To this:
if (!IsPostBack)
{
   Session["dsOrderDetail"] = this.oOrderDetail.GetOrderDetail(this.OrderID);
}
else
{
   DataSet dsOrderDetail = (DataSet)Session["dsOrderDetail"];
   this.oOrderDetail.SetCurrentDataSet(dsOrderDetail);
}
This does:
       // To implement adding detail records
        if (!IsPostBack)
        {
            this.oOrderDetail.GetOrderDetail(this.OrderID);
            Session["dsOrderDetail"] = this.oOrderDetail.DataSet;
         }
        else
        {  
            DataSet dsOrderDetail = (DataSet)Session["dsOrderDetail"];
            this.oOrderDetail.SetCurrentDataSet(dsOrderDetail);
        }
Kevin, This does relate somewhat to my post yesterday of 2 lines of code in saving a data session vs. one line. Is there something I may have mis-coded?

Thanks, Ted
Next
Reply
Map
View

Click here to load this message in the networking platform