Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0cmdUpdate_Click problem : it records old values when updatingcmdUpdate_Click problem : it records old values when updating
Previous
 
Next
New Post
3/15/2008 4:17 PM
 

Hi,

I have a big problem. I made a module using starter kit. Everything works well, but I cannot record. I've localized the problem. When I insert a breakpoint, I see that the textbox contains the former value.

I'm sure it's the problem because when I insert a value by setting the value in the code, it's ok.

Does someone know how I can resolve this problem ?

Here is the .cs code :

using

System;

using

DotNetNuke;

using

DotNetNuke.Common;

using

DotNetNuke.Common.Utilities;

using

DotNetNuke.Entities.Modules;

using

DotNetNuke.Services.Exceptions;

using

DotNetNuke.Services.Localization;

namespace

{

 

YourCompany.Modules.ECWCalendar/// -----------------------------------------------------------------------------

 

/// <summary>

 

/// The EditECWCalendar class is used to manage content

 

/// </summary>

 

/// <remarks>

 

/// </remarks>

 

/// <history>

 

/// </history>

 

/// -----------------------------------------------------------------------------

 

partial class EditECWCalendar : PortalModuleBase

{

#region

 

Private Membersprivate int ItemId = Null.NullInteger;

#endregion

#region

 

Event Handlers/// -----------------------------------------------------------------------------

 

/// <summary>

 

/// Page_Load runs when the control is loaded

 

/// </summary>

 

/// <remarks>

 

/// </remarks>

 

/// <history>

 

/// </history>

 

/// -----------------------------------------------------------------------------

 

{

 

protected void Page_Load(System.Object sender, System.EventArgs e)try

{

 

 

 

ECWCalendarController ecwCalendarController = new ECWCalendarController();ECWCalendarDetailController ecwCalendarDetailController = new ECWCalendarDetailController();//If this is the first visit to the page, bind the role data to the datalist

 

{

 

 

if (Page.IsPostBack)int ecwCalendarId = Convert.ToInt32(cboRaces.SelectedValue);// load element

 

 

 

ECWCalendarDetailInfo ecwCalendarDetailInfo = ecwCalendarDetailController.GetECWCalendarDetail(ecwCalendarId);if (ecwCalendarDetailInfo == null)// Doesn't exist => create detail for this race

{

ecwCalendarDetailInfo =

ecwCalendarDetailInfo.ECWCalendarID = ecwCalendarId;

 

ecwCalendarDetailInfo.ProvinceId =

new ECWCalendarDetailInfo();int.Parse(Settings["province"].ToString());int.Parse((string)Settings["province"]); // = default module value

ecwCalendarDetailInfo.RegistrationFrom = (

string)Settings["registrationfrom"]; // = default module value

ecwCalendarDetailInfo.RegistrationTo = (

string)Settings["registrationto"]; // = default module value

ecwCalendarDetailInfo.StartTimeA = (

string)Settings["starttimea"]; // = default module value

ecwCalendarDetailInfo.DistanceA = (

string)Settings["distancea"]; // = default module value

ecwCalendarDetailInfo.StartTimeB = (

string)Settings["starttimeb"]; // = default module value

ecwCalendarDetailInfo.DistanceB = (

string)Settings["distanceB"]; // = default module value

ecwCalendarDetailInfo.StartTimeC = (

string)Settings["starttimec"]; // = default module value

ecwCalendarDetailInfo.DistanceC = (

string)Settings["distancec"]; // = default module value

ecwCalendarDetailInfo.BibsPosition =

Convert.ToInt32(Settings["bibsposition"]); // = default module value

ecwCalendarDetailInfo.Approved =

ecwCalendarDetailInfo.CreatedByUser = UserInfo.Username;

ecwCalendarDetailInfo.CreatedDate =

ecwCalendarDetailController.AddECWCalendarDetail(ecwCalendarDetailInfo);

}

 

false;DateTime.Now;// Fills the form

 

}

 

this.FillsForm(ecwCalendarDetailInfo);else

{

 

// Load races

cboRaces.DataSource = ecwCalendarController.GetFormatedECWCalendars(PortalId);

cboRaces.DataBind();

 

// Load provinces

cboProvinces.DataSource = ecwCalendarDetailController.GetECWProvinces();

cboProvinces.DataBind();

}

}

 

catch (Exception exc) //Module failed to load

{

 

}

}

 

{

cboProvinces.SelectedValue = ecwCalendarDetailInfo.ProvinceId.ToString();

txtRegistrationPlace.Text = ecwCalendarDetailInfo.RegistrationPlace;

txtRegistrationFrom.Text = ecwCalendarDetailInfo.RegistrationFrom;

txtRegistrationTo.Text = ecwCalendarDetailInfo.RegistrationTo;

txtChanginRoom.Text = ecwCalendarDetailInfo.ChangingRoom;

txtStartTimeA.Text = ecwCalendarDetailInfo.StartTimeA;

txtDistanceA.Text = ecwCalendarDetailInfo.DistanceA.ToString();

txtStartTimeB.Text = ecwCalendarDetailInfo.StartTimeB;

txtDistanceB.Text = ecwCalendarDetailInfo.DistanceB.ToString();

txtStartTimeC.Text = ecwCalendarDetailInfo.StartTimeC;

txtDistanceC.Text = ecwCalendarDetailInfo.DistanceC.ToString();

rdblBibsPosition.SelectedIndex = ecwCalendarDetailInfo.BibsPosition;

cbApproved.Checked = ecwCalendarDetailInfo.Approved;

ctlAudit.CreatedByUser = ecwCalendarDetailInfo.CreatedByUser.ToString();

ctlAudit.CreatedDate = ecwCalendarDetailInfo.CreatedDate.ToShortDateString();

ctlAudit.Visible =

}

 

Exceptions.ProcessModuleLoadException(this, exc);private void FillsForm(ECWCalendarDetailInfo ecwCalendarDetailInfo)true;/// -----------------------------------------------------------------------------

 

/// <summary>

 

/// cmdCancel_Click runs when the cancel button is clicked

 

/// </summary>

 

/// <remarks>

 

/// </remarks>

 

/// <history>

 

/// </history>

 

/// -----------------------------------------------------------------------------

 

{

 

protected void cmdCancel_Click(System.Object sender, System.EventArgs e)try

{

 

}

 

this.Response.Redirect(Globals.NavigateURL(this.TabId), true);catch (Exception exc) //Module failed to load

{

 

}

}

 

Exceptions.ProcessModuleLoadException(this, exc);/// -----------------------------------------------------------------------------

 

/// <summary>

 

/// cmdUpdate_Click runs when the update button is clicked

 

/// </summary>

 

/// <remarks>

 

/// </remarks>

 

/// <history>

 

/// </history>

 

/// -----------------------------------------------------------------------------

 

{

 

protected void cmdUpdate_Click(System.Object sender, System.EventArgs e)try

{

 

 

ecwCalendarDetailInfo.ECWCalendarID =

 

ecwCalendarDetailInfo.ProvinceId =

ecwCalendarDetailInfo.RegistrationPlace = txtRegistrationPlace.Text.Trim();

ecwCalendarDetailInfo.RegistrationFrom = txtRegistrationFrom.Text.Trim();

ecwCalendarDetailInfo.RegistrationTo = txtRegistrationTo.Text.Trim();

ecwCalendarDetailInfo.ChangingRoom = txtChanginRoom.Text.Trim();

ecwCalendarDetailInfo.StartTimeA = txtStartTimeA.Text.Trim();

ecwCalendarDetailInfo.DistanceA = txtDistanceA.Text.Trim();

ecwCalendarDetailInfo.StartTimeB = txtStartTimeB.Text.Trim();

ecwCalendarDetailInfo.DistanceB = txtDistanceB.Text.Trim();

ecwCalendarDetailInfo.StartTimeC = txtStartTimeC.Text.Trim();

ecwCalendarDetailInfo.DistanceC = txtDistanceC.Text.Trim();

ecwCalendarDetailInfo.BibsPosition = rdblBibsPosition.SelectedIndex;

ecwCalendarDetailInfo.Approved = cbApproved.Checked;

ecwCalendarDetailInfo.CreatedByUser = UserInfo.Username;

ecwCalendarDetailInfo.CreatedDate =

 

ECWCalendarDetailController ecwCalendarDetailController = new ECWCalendarDetailController();ECWCalendarDetailInfo ecwCalendarDetailInfo = new ECWCalendarDetailInfo();Convert.ToInt32(cboRaces.SelectedValue);Convert.ToInt32(cboProvinces.SelectedValue);DateTime.Now;//Update the content within the ECWCalendar table

ecwCalendarDetailController.UpdateECWCalendarDetail(ecwCalendarDetailInfo);

 

 

//refresh cache

 

}

 

ModuleController.SynchronizeModule(ModuleId);catch (Exception exc) //Module failed to load

{

 

}

}

Exceptions.ProcessModuleLoadException(this, exc);

#endregion

}

}

 
New Post
3/18/2008 8:57 PM
 

Hi.  Have you solved your problem?

I'm guessing.. but maybe you're not getting a postback for some reason?   I had an issue with a FileUpload in an UpdatePanel which was inside a MultiView and I had to set up a PostBackTrigger for the 'upload' button.           Just an idea.     Hope it helps.


Daniel

 
Previous
 
Next
HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0cmdUpdate_Click problem : it records old values when updatingcmdUpdate_Click problem : it records old values when updating


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out