Click here to Skip to main content
15,921,531 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am facing a very different problem, i have made a button save and defined its onsaveclick, but no event is being fired on clicking that button,however it is working for the other two buttons.. below is my code: on region.ascx
C#
<lpsfsu:CommandBar ID="fsucCommandBarItemCostAdjustment"  runat="server" DefaultPanel="pnlZoneMaintenanceItemCostAdjustmentControls"
           DisplayButtons="Save,Submit,Cancel" AutoPostbackButtons="Save,Submit,Cancel"
           ValidationGroup="grpVldZoneMaintenance" CauseValidationOnCancel="false" ButtonPosition="Right"
           DefaultPanelButton="Save" OnSaveClick="btnSave_Click" OnCancelClick="btnCancel_Click"
            önSubmitClick="btnSubmit_Click" />

on regionascx.cs
C#
protected void btnSave_Click(object sender, EventArgs e)
      {
          // This is save in Draft mode.
          try
          {
              if (_currentTabMode.Equals(ZoneMaintenanceFormMode.Approval))
              {
                  if (ValidateComments())
                  {
                      // Record to be Approved
                      CurrentViewContext.ViewContract.ZoneStatus = ZoneMaintenanceStatus.Approved;

                      // Set Approved in Queue
                      String errorCode = Presenter.SaveZoneToQueue();

                      // Set Approved in DB Only in case of define zone.
                      Presenter.SaveItemZoneCosts();

                      grdItemCostAdjustment.Rebind();

                      ProcessErrorCode(errorCode);

                      _currentTabMode = ZoneMaintenanceFormMode.ReadOnly;

                      ShowCommentHistory(CurrentViewContext.ViewContract.TransactionId);

                      //After Approve move to the parent page
                      RedirectToOriginatedPage();
                  }
              }
              else
              {
                  Int32 zoneId = _viewContract.IsNull() ? SysXConsts.MINUS_ONE : _viewContract.ZoneId;

                  // Validate controls
                  if (ValidateControls())
                  {
                      // Create/Update Define Zone Context in Queue
                      CurrentViewContext.ViewContract.ZoneStatus = ZoneMaintenanceStatus.Draft;

                      // Display appropriate message based on error code
                      ProcessErrorCode(Presenter.SaveZoneToQueue());

                      //Save value in DB in with IsApproved = 0
                      Presenter.SaveItemCosts();

                      ShowCommentHistory(CurrentViewContext.ViewContract.TransactionId);

                      //set ids in viewstate
                      ViewState[SysXZoneMaintenanceConst.ZONEMAINTENANCE_ITEM_COST_TRANSACTIONID] = CurrentViewContext.ViewContract.TransactionId;
                  }

              }

          }
Posted
Updated 2-May-13 4:25am
v2
Comments
ZurdoDev 2-May-13 10:49am    
You may need to check with lpsfsu

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900