Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Jump Start: Web Forms Application - C#, Step 17
Message
De
26/09/2006 14:47:32
 
 
À
Tous
Information générale
Forum:
ASP.NET
Catégorie:
The Mere Mortals .NET Framework
Titre:
Jump Start: Web Forms Application - C#, Step 17
Divers
Thread ID:
01157320
Message ID:
01157320
Vues:
57
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
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform