Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Web Form
Message
Information générale
Forum:
ASP.NET
Catégorie:
The Mere Mortals .NET Framework
Titre:
Divers
Thread ID:
01409563
Message ID:
01410035
Vues:
33
Eric,

I do not see how this changes anything as all my web forms in my app do not do this. I always set the session variable for the dataset in the Page_Load regardless of postback status and everything works fine. So I am at a loss as to why this works for you. In fact, I would think that the dataset values will not be saved properly.

When you now click the save button you will set the oOrder.Dataset to the session variable that was created in your original load of the page and then the same line of code will be executed again in the Save_click method. That doesn't seem right to me. What if you had multiple postbacks due to server requests for dropdown boxes or business rules failed that caused other postbacks, etc. Your session variable for the dataset will never change and I think you would not have the proper values stored.

The fact that the dev guide does not instruct this tells me that this is not the way to do this. Again, as I mentioned previously, I do not know the inner workings enough to say that this is correct or not. But, I would be cautious.

Hopefully, Tim chimes in here again as I am sure he would be able to give you more insightful perspective on the inner workings.

HTH


>Ok, I think I see what I had to do, but correct me if I'm wrong. I tweaked the page_load to look like this:
>
>
>        if (IsPostBack)
>        {
>            this.oOrder.DataSet = (DataSet)Session["dsOrder"];
>        }
>        else { Session["dsOrder"] = this.oOrder.DataSet; }
>
>
>This brings the bound values back properly when their trying to save the order, and now they're available when I get down to the btnSave_Click(). I don't see examples like this in the dev guide though, which makes me wonder.
>
>Thanks everyone!
>
>Eric
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform