Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Webform showstopper for me
Message
Information générale
Forum:
ASP.NET
Catégorie:
The Mere Mortals .NET Framework
Divers
Thread ID:
01337052
Message ID:
01337343
Vues:
10
Jeff,

I ran into some issues when re-populating EntityLists in that they would automatically re-bind to some controls (In MM.Net for .Net 2.0). Try something like this when you repopulate your EntityList:

YourBizObj.AutoRaiseStateChangeEvents = false;
YourBizObj.EntityList = YourBizObj..GetRequestedByVisitIdByAccountId(AccountId, aVisit.Entity.VID);
// Set your other values here and save, then turn AutoRaiseStateChangeEvents back on
YourBizObj.AutoRaiseStateChangeEvents = true;

Regards,

E.R.

>I've created a BO and a MM webform with some but not all of the BO Entity properties on the form as MM controls. I have a webmodified (datetime) BO Entity property that I want to populate in the btnSave_Click (see below) as well as webmodified property. However, neither of these gets saved. Since I'm editing an existing record in the table the old values get retrieved and replaced by the old values. If, OTOH, the BO Entity property is bound to an MM control on the webform the value I enter via the webform gets successfully saved as expected.
>
>In the future I need to add two textboxes or one textbox and a calendar control that will act as a datetime (including the time) picker and then in code I will need to combine the values from the web controls and populate a BO Entity property like webmodfied and webmodby (see below).
>
>But, again, none of this is working as expected.
>
>Please help.
>
>
>********************************************************************
>    protected void btnSave_Click(object sender, EventArgs e)
>    {
>        DataSet dsResponse = (DataSet)Session["dsResponse"];
>
>        this.oResponse.Entity.webmodby = User.Identity.Name;
>        this.oResponse.Entity.webmodified = DateTime.Now;
>
>        string junk = this.oResponse.Entity.saastaff;  //this value is null
>        string junk2 = this.txtRAStaff.Text;
>
>        mmSaveDataResult saveResult;
>        saveResult = this.Save(this.oResponse, dsResponse, this.oResponse.TableName);
>
>        if (saveResult == mmSaveDataResult.RulesPassed)
>        {
>            Response.Redirect("main.aspx?msg=" + HttpUtility.HtmlEncode("Your data has been saved"));
>            return;
>        }
>        if (saveResult == mmSaveDataResult.Exception)
>        {
>            DisplayError("A 'handled' exception has occurred.  Could not save data.  Please contact Application Administrator.");
>        }
>    }
>
Regards,

E.R. Gilmore
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform