Child form calling method in Parent

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • fullmetal87
    New Member
    • Mar 2007
    • 5

    Child form calling method in Parent

    Hi I having a problem with calling the parent method from child form. I am working on an asp .net application.

    I place the code below under the hyplinkcontrol as the navigation url. And it do open a new window.

    Code:
    javascript:theWin=window.open('AssetType_Popup.aspx);theWin.focus
    And in the child form i coded this to call the parent method.
    Code:
    Response.Write("<script>opener.Postback('Insert'," + Request.QueryString("AssetTypeCode") + ");</script>")
    The parent method will direct itself and reload with fields accordingly
    Code:
    function Postback(operation,code) 
    {	
    self.location.href = 'AssetType_Main.aspx?Reload='+ operation + '&AssetTypeCode=' + code;
    }

    The problem is that when I run the code it doesn't call the parent code. May I know how to solve this problem? Thank you
  • acoder
    Recognized Expert MVP
    • Nov 2006
    • 16032

    #2
    Welcome to TheScripts.

    Try:
    Code:
    Response.Write("<script>window.opener.Postback('Insert','" + Request.QueryString("AssetTypeCode") + "');</script>")
    You've missed the quotes.

    Comment

    • fullmetal87
      New Member
      • Mar 2007
      • 5

      #3
      thks I found my problem
      it work fine now =D

      This code return empty result tat causes my javascript to failed.
      Code:
      Request.QueryString("AssetTypeCode")
      Thanks for your help

      Comment

      • dmjpro
        Top Contributor
        • Jan 2007
        • 2476

        #4
        u can use window.opener.f un_ref ......

        fun_ref is used in parent form ....... best of luck

        Comment

        Working...