2017-06-14 10 views
0

aspxページから開くダイアログボックスを作成しました。ダイアログボックスには、フッターのボタンとともに情報が含まれています。 MERGEと閉じる。asp.netのダイアログボックスからクリックイベントが発生しない

以下は、私が開くために使用したダイアログボックスです。これは正常に作成され、情報が入力されます。しかし、ダイアログボックスの "MERGE"ボタンをクリックしても、ナビゲーションがコードビハインドファイルに転送されないため、何もしません。

コードの後ろにClickイベントが正常に定義されましたが、なぜそれが発生していないのかわかりません。

protected void btnMerge_Click(object sender, EventArgs e) 
    { 
     try 
     { 
      // SessionUtility.SetSession(Constants.LASTREVIEWGROUPIDPROCESSED, this.ReviewGroup.ReviewGroupId); 
      if (preventEvents) 
      { 
       Response.Redirect(Request.RawUrl, false); 
       return; 
      } 


      // ensure no action taken on current review group(partially or completly) 
      #region Handle review group for completly processed case 
      var selectedAssignment = SessionUtility.GetSession(Constants.SELECTEDUSERASSIGNMENT) as Assignment; 
      var currentReviewGroupID = hdnReviewGroupID.Value.ToString(); 

      if (currentReviewGroupID != selectedAssignment.ReviewGroupId) 
      { 
       selectedAssignment.ReviewGroupId = currentReviewGroupID; 
       SessionUtility.SetSession(Constants.SELECTEDUSERASSIGNMENT, selectedAssignment); 
       LoadNextReviewGroup(null, null); 
       lblPreviousReviewGroupId.Text = string.Format(StaticConstants.REVIEWGROUPVALIDATIONMESSAGE, currentReviewGroupID); 
       lblPreviousReviewGroupId.Visible = true; 
       return; 
      } 


      #endregion 
      if (!string.IsNullOrEmpty(selectedIds)) 
      { 
       SessionUtility.SetSession(Constants.USERSERLECTIONROWIDS, selectedIds); 
       if (BtnMerge_Click != null) 
       { 
        BtnMerge_Click(sender, e); 
       } 
       Response.Redirect("MergeGroup.aspx", false); 
      } 
     } 
     catch (Exception ex) 
     { 
      SessionUtility.SetSession(Constants.Error, ex); 
      NavigationHelper.ToErrorPage(false); 
     } 
    } 

私のクライアントのクリックイベントがfine.Theに取り組んでいる

aspxページ

<div class="modal-dialog" id="updateConfirmPopUp" style="display: none"> 
    <div class="modal-content"> 
     <div class="modal-header" id="popUpHeader"> 
      <button type="button" class="close closePopup"> 
       <span>&times;</span></button> 
     </div> 
     <div class="modal-body" id="confirmData"> 
      <div id="random"></div> 
      <div class="dataTable_wrapper"> 
       <div class="table-responsive"> 
        <uc:ReviewGroupGrids ID="reviewGroupCtrls" runat="Server" /> 
       </div> 
      </div> 
     </div> 
     <div class="modal-footer"> 
      <asp:Button ID="Button1" runat="server" Text="Review Next" OnClick="btnMerge_Click" /> 
      <button type="button" id="btnClosePopUp" class="btn btn-default closePopup"> 
       Okay</button> 
     </div> 
    </div> 
</div> 

aspx.csページ唯一の問題は、onClickイベントです。

+0

のようなものは、あなたがどこかで更新パネルを使用して持っていますか? –

+0

いいえ私はアップデートパネルを使用していません – Yash

+0

プロパティ "AutoPostBack"を見つけることができません – Yash

答えて

1

HTMLボタンでサーバーサイドコードを呼び出すことはできません。 runat = "server"タグでaspボタンを使用する必要があります。

 <asp:Button ID="btnMerge" runat="server" Text="MERGE" OnClick="btnMerge_Click" /> 
関連する問題