2012-04-25 2 views
0

고유 한 처리 문제에 대한 도움을 받고 싶습니다. 이러한 제약 조건에서 특정 솔루션을 찾고 있습니다.전달 취소 또는 업데이트 버튼 팝업에서 상위 페이지로 이동

부모 페이지 gridview에서 데이터를받는 팝업 aspx 페이지가 있습니다. 부모 페이지에서 팝업으로 데이터를 파싱하는 데는 많은 양의 데이터가 파싱되며, 데이터가 팝업으로 번역되면 부모 페이지로 다시 보내져 업데이트 전에 원본 텍스트 블록으로 재구성됩니다.

팝업이 데이터를 다시 전달하거나 취소되면 상위 페이지 gridview는 여전히 편집 모드입니다.

취소 또는 업데이트 버튼 클릭을 팝업에서 부모 페이지 gridview로 전달하여 사용자가 gridview 편집 모드에서 해당 명령 버튼 링크를 클릭하도록 요청하지 않고 업데이트 또는 취소 이벤트를 완료 할 수 있도록하려고합니다. 업데이트 또는 취소.

저는 이것을 실제로 수행하는 방법을 완전히 이해하기 위해 튜토리얼, 링크 또는 샘플 코드를 찾고 있습니다.

업데이트 : 팝업 페이지 처리가 완료 될 때까지 사용자가 페이지로 돌아 가지 않도록 부모 페이지에 jquery UIBlocker가 있습니다.

상위 페이지 : 다음은 중요한 코드입니다 뒤에

function parentFunc(a) { 
    // Unblocks on return from popup page. 
    $.unblockUI({}); 
    document.getElementById("<%=Textbox1.ClientID %>").value = a; 

    alert("Please complete the update by entering a Brief Description then clicking the UPDATE link!!"); 
} 

function parentCancel(s) { 
    // Unblocks because of cancel from popup page. 
    // var a = 0; 
    $.unblockUI({}); 

    alert("Please click the Cancel link to complete the Cancel process!!"); 
} 

상위 페이지 번호, 행 Updatinfg 이벤트 문자열의 배열을 구축 한 후 팝업 페이지로 전달합니다.

' Sets up popup to open when row selected for edit is cycled. 
If IsPostBack Then 
    If (e.Row.RowState And DataControlRowState.Edit) > 0 Then 
     If Session("updateComplete") <> "Y" And Session("CancelUpdate") <> "Y" Then 

      Dim BrowserSettings As String = "status=no,toolbar=no, scrollbars =yes,menubar=no,location=no,resizable=no," & "titlebar=no, addressbar=no, width=850, height=800" 
      Dim URL As String = "NewpttStringPopUp.aspx" 
      Dim dialog As String = URL 
      Dim scriptText1 As String = ("<script>javascript: var w = window.open('" & URL & "','_blank','" & BrowserSettings & "'); $.blockUI({ message: '<h1>Please translate text and click Submit...</h1>' }); </script>") 

      ScriptManager.RegisterStartupScript(Me, GetType(Page), "ClientScript1", scriptText1, False) 
      Session("updateComplete") = "N" 
     End If 
    End If 
End If 

팝업 페이지 :

function closeform() { 
    alert("Please click the Cancel Button at the buttom of the page to Cancel the process!!"); 

    return "Please click the Cancel Button at the buttom of the page to Cancel the process!!"; 
    } 

function handleWindowClose() { 
    if ((window.event.clientX < 0) || (window.event.clientY < 0)) { 
     event.returnValue = "If you have made any changes to the fields without clicking the Save button, your changes will be lost."; 
    } 
} 

function callParentFunc() 
{ 
    var w = window.opener; 
    var a; 
    if (!w.closed) { 
     var val = w.parentFunc(a); 
     self.close(); 
    } 
    this.window.focus() 
} 

function callParentCancel() { 
    var w = window.opener; 
    var s; 
    if (!w.closed) { 
    var val = w.parentCancel(s); 
    self.close(); 
    } 
} 

POPUP.ASPX.VB 코드 뒤에 취소 버튼

Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click 
    ' Cancel Button so that no update is processed. 
    ' Sets flag to prevent java popup from reopening after RowUpdating event. Occurs in RowDataBound event. 
    'Dim s As String = "c" 
    Dim strScript2 As String = "callParentCancel();" 
    ClientScript.RegisterStartupScript(GetType(Page), "callParentCancel", strScript2.ToString, True) 

    Session("UpdateEnd") = "Y" 
    Session("CancelUpdate") = "Y" 
    'Response.Write("<script>window.close();</script>") 
End Sub 

POPUP.ASPX.VB 코드 뒤에 제출 버튼

arrary를 구축개

프로세스는

Session("returnTranslation") = arReturn 

    ' Page.PreviousPage.Focus() 

    Dim strScript As String = "callParentFunc();" 
    ClientScript.RegisterStartupScript(GetType(Page), "callParentFunc", strScript.ToString, True) 

    ' Sets flag to prevent java popup from reopening after RowUpdating event. Occurs in RowDataBound event. 
    Session("updateComplete") = "Y" 

가 다시로드에서 팝업 방지에 문제가 있었다 .. breivity 표시되지 않습니다. 따라서로드 이벤트에 if 조건이 있습니다. 동적 인 컨트롤 수는 리터럴로 팝업에 작성됩니다. 따라서 Page Init 이벤트와 Page Load 이벤트는 비 Postback에서 실행되어 컨트롤을 다시 작성합니다.

감사의 말로 모든 제안 사항을 검토합니다.

답변