Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Webform showstopper for me
Message
De
06/08/2008 18:18:25
Timothy Bryan
Sharpline Consultants
Conroe, Texas, États-Unis
 
 
À
06/08/2008 16:59:18
Information générale
Forum:
ASP.NET
Catégorie:
The Mere Mortals .NET Framework
Divers
Thread ID:
01337052
Message ID:
01337080
Vues:
9
Hi Jeff,

>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.");
> }
> }

Just so I am clear on what you are doing.
1. You are adding a new record on the webform
2. The user adds some data in the bound fields
3. On the user click you want to fill in the data for the fields that are not on the form
4. You want to save the whole thing

You indicated since you were editing an existing record. This is where I am not so clear on what you are doing. I don't see your code where you are retrieving a specific record so when you set the entity values, which entity record are you editing?

Tim
Timothy Bryan
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform