2012-04-25 13 views
0

独自の処理の問題について助けを求めたいと思います。私はこれらの制約がある特定のソリューションを探しています。パスのキャンセルまたは更新ボタンポップアップから親ページへのクリック

私は親ページのgridviewからデータを受け取るポップアップaspxページを持っています。親ページからポップアップまでのデータの解析は大量であり、データがポップアップで翻訳されてから親ページに戻され、更新前の元のテキストブロックに再アセンブリされます。

ポップアップがデータを返すかキャンセルされると、親ページのグリッドビューはまだ編集モードです。

ポップアップから親ページのグリッドビューへの「キャンセル」または「更新」ボタンのクリックを渡して、グリッドビュー編集モードから対応するコマンドボタンリンクをクリックするようにユーザーに要求せずに、更新またはキャンセルイベントを完了できます。更新またはキャンセル。

私は実際にこれを行う方法を完全に理解したいので、チュートリアル、リンクまたはサンプルコードを探しています。

UPDATE:PopUpページの処理が完了するまで、ユーザーがページに戻るのを防ぐために、親ページに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イベントPOPUPページに渡す文字列の配列を構築した後。

' 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 

POPUPページ

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を構築するの

プロセスがbreivityでは表示されません。..

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" 

はリロードからのポップアップを防止することに問題がありました。したがって、loadイベントにはif条件があります。ダイナミックなコントロールの数は、ポップアップでリテラルとして構築されます。したがって、Page InitイベントとPage Loadイベントは非ポストバックで発生し、コントロールを再構築します。

ありがとうございます、すべての提案が見直されます。

答えて

関連する問題