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:
01337073
Vues:
14
>Jeff,
>
>I wonder if this is the same problem I encountered in Windows Forms when I added some code to the click of the mmbuttonNew control. The problem there was that I had to set the datarow to the newly added row. (I encountered the same issue when trying to update a field from the save button click method.) You may have to do the same thing on an edit. The code is listed under "Using Specialized Buttons", part of "Creating Windows Forms Applications". You'll have to modify it to use the current record rather than the last record, though.
>
>>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.");
>> }
>> }

Thanks, but I don't think that is the right answer for my situation. Similar, yes.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform