CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Jul 2006
    Posts
    141

    Resolved Modal Pop Up pass value to parent page and Post back the parent page

    Hi, i have created a web user control and use it as a modal popup where user can select a list of record from grid view and pass back the value to the parent page and postback the parent page so that the parent page can diplay additional info base on the value. I have try with the window.openener but it does not work.Does anyone has any idea ? My coding is as below

    Web control gui
    Code:
    
       Public Sub Show()
            ModalPopupExtenderSearch.Show()
    
        End Sub
    
    Protected Sub gvCustomer_RowCommand(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewCommandEventArgs) Handles gvCustomer.RowCommand
    
    
            Dim strCustCode As String
            Dim index As Integer = Convert.ToInt32(e.CommandArgument)
            Dim strBuilder As New StringBuilder
    
    
            Try
    
                If index <= gvCustomer.Rows.Count - 1 Then
                    If e.CommandName = "Select" Then
    
                        strCustCode = CType(gvCustomer.Rows(index).Cells(0).FindControl("lblCustCode"), Label).Text
    
                        Literal1.Text = strBuilder.ToString()
                        strBuilder.Append("<SCRIPT LANGUAGE=javascript>")
                        strBuilder.Append("window.opener.document.forms(0).submit();")
                        strBuilder.Append("</SCRIPT>")
                        Literal1.Text = strBuilder.ToString()
    
                    End If
    
                End If
    
            Catch ex As Exception
                Throw ex
            End Try
        End Sub
    Parent page
    Code:
    Protected Sub imgSearch_Click(ByVal sender As Object, ByVal e As System.Web.UI.ImageClickEventArgs) Handles imgSearch.Click
            SearchCustomerWithJob.Show()
        End Sub
    
        Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
            If Not Page.IsPostBack Then
    
            Else
           ''get customer additional info
           dim strCustomerCode as string 
          strCustomerCode = '' get from   SearchCustomerWithJob which is a modal pop up
    
          PopulateCustInfo(strCustomerCode)
    
            End If
        End Sub

  2. #2
    Join Date
    Sep 2011
    Posts
    1

    Re: Modal Pop Up pass value to parent page and Post back the parent page

    I realize this is an old post, but I am facing a very similar issue. Have you solved this issue yet?

    Thanks,

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured