Transfer Date from one page to another in aspx

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Frinavale
    Recognized Expert Expert
    • Oct 2006
    • 9749

    #16
    Originally posted by imtmub
    I have place my function inside <div></div> but still its acting same. I m not getting what i want.
    Are you using AJAX?
    Do you have your "child" object within one UpdatePanel and your parent in another? If this is the case, then your parent will be refreshed with old data.....

    -Frinny

    Comment

    • DrBunchman
      Recognized Expert Contributor
      • Jan 2008
      • 979

      #17
      Originally posted by Frinavale
      I'm not the greatest with JavaScript but I'm almost 100% sure that you cannot transfer data between a child and parent browser.
      If that's the case then how come this:
      Code:
      document.opener.document.getElementById("TextBox1").value = 'Hello World!'; window.close();
      works as a method of passing data back from child window to parent? I've used this method successfully to pass data back from calendar pop-ups and the like many times and I can't see how, with this being client-side JS, it could be passing it through the server rather than the browser.

      I could, of course, be completely wrong and I would be interested if anybody knew how this worked.

      Dr B

      Comment

      • imtmub
        New Member
        • Nov 2006
        • 112

        #18
        Originally posted by Frinavale
        Are you using AJAX?
        Do you have your "child" object within one UpdatePanel and your parent in another? If this is the case, then your parent will be refreshed with old data.....

        -Frinny
        My website is not AJAX enabled. I m not using AJAX. So i dont have update panel on my pages.

        Comment

        • DrBunchman
          Recognized Expert Contributor
          • Jan 2008
          • 979

          #19
          imtmub,

          Have you managed to get this sorted yet?

          Dr B

          Comment

          • Frinavale
            Recognized Expert Expert
            • Oct 2006
            • 9749

            #20
            Originally posted by DrBunchman
            imtmub,

            Have you managed to get this sorted yet?

            Dr B
            If not, could you please post any code that is relevant to this problem so that we can figure out what is wrong.

            -Frinny

            Comment

            • imtmub
              New Member
              • Nov 2006
              • 112

              #21
              Originally posted by DrBunchman
              imtmub,

              Have you managed to get this sorted yet?

              Dr B
              Yes.Finally decided not to use Master page. Instead of master page i have created user controls then placed on my pages. Anyhave i m really appriciating all of you people for the answers.

              Comment

              • imtmub
                New Member
                • Nov 2006
                • 112

                #22
                Originally posted by Frinavale
                If not, could you please post any code that is relevant to this problem so that we can figure out what is wrong.

                -Frinny
                Hello Frinavale,
                I have solved using user controls instead of master page.

                Anyhave lets have a try if u can solve the master page issue.

                Here my parent Page(SingleLeve lN.aspx). This page is master page enabled.
                Code:
                 
                %@ Page Language="VB" MasterPageFile="~/aspx/MasterPage.master" AutoEventWireup="false" CodeFile="SingleLevelN.aspx.vb" Inherits="aspx_SingleLevelN" title="Report-SingleLevelBOM" %>
                 
                <%@ Register Assembly="CrystalDecisions.Web, Version=10.2.3600.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"
                Namespace="CrystalDecisions.Web" TagPrefix="CR" %>
                <asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
                SelectParentId<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox><a href="#"
                onclick="OpenNewWindow()">Lookup</a>
                <asp:Button ID="Button1" runat="server" Text="Button" /><br />
                <CR:CrystalReportViewer ID="CrystalReportViewer1" runat="server" AutoDataBind="true"
                EnableParameterPrompt="False" ReportSourceID="CrystalReportSource1" />
                <CR:CrystalReportSource ID="CrystalReportSource1" runat="server">
                <Report FileName="BOM1.rpt">
                <Parameters>
                <CR:ControlParameter ControlID="TextBox1" ConvertEmptyStringToNull="False" DefaultValue=""
                Name="ParentId" PropertyName="Text" ReportName="" />
                </Parameters>
                </Report>
                </CR:CrystalReportSource>
                <script language="javascript" type="text/javascript">
                 
                function OpenNewWindow() 
                {
                window.open('ChildMain.aspx','MyPopUp','width=500,height=700,scrollbars=1,resizable=1');
                }
                 
                </script>
                 
                </asp:Content>
                Child Page(Childmain. aspx).
                Code:
                   
                <%@ Page Language="VB" AutoEventWireup="false" CodeFile="ChildMain.aspx.vb" Inherits="aspx_ChildMain" %>
                 
                <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
                 
                <html xmlns="http://www.w3.org/1999/xhtml" >
                <head runat="server">
                <title>Untitled Page</title>
                <script type="text/javascript">
                function Transfer() 
                {
                //window.opener.form1.TextBox1.value = document.getElementById('" & Request.Querystring("txt") & "').value;
                window.opener.document.forms[0].Textbox1.value = document.getElementById("Textbox1").value;
                 
                window.close(); 
                }
                </script>
                </head>
                <body>
                <form id="form1" runat="server">
                <div>
                Select Query Type
                <asp:RadioButtonList ID="RadioButtonList1" runat="server" RepeatDirection="Horizontal"
                Width="173px">
                <asp:ListItem Selected="True" Value="ItemId">ItemId</asp:ListItem>
                <asp:ListItem>ItemName</asp:ListItem>
                </asp:RadioButtonList>Enter the Item
                <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
                <asp:Button ID="Button1" runat="server" Text="Find" Width="68px" />
                &nbsp;<input id="Button2" onclick="Transfer()" type="button" value="Select" style="width: 65px" /><br />
                &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="font-size: 9pt">
                &nbsp; &nbsp; &nbsp; &nbsp; Example(11001% or 316%8)<asp:GridView ID="GridView1"
                runat="server" AutoGenerateColumns="False" DataKeyNames="ItemID" DataSourceID="SqlDataSource1"
                Font-Names="Times New Roman" Font-Size="11pt" Width="463px">
                <Columns>
                <asp:CommandField ShowSelectButton="True">
                <ItemStyle Width="85px" />
                <ControlStyle Font-Size="Medium" />
                </asp:CommandField>
                <asp:BoundField DataField="ItemID" HeaderText="ItemID" ReadOnly="True" SortExpression="ItemID">
                <ItemStyle Width="85px" />
                </asp:BoundField>
                <asp:BoundField DataField="ItemName" HeaderText="ItemName" SortExpression="ItemName" />
                </Columns>
                </asp:GridView>
                </span><br />
                <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:IERP52ConnectionString3 %>"
                SelectCommand="If @QryType='ItemId' Begin Select top 1000 ima_itemid as ItemID, ima_itemName as ItemName from ima where (ima_itemid LIKE @IMA_ItemID) end Else Begin Select top 1000 ima_itemid as ItemID, ima_itemName as ItemName from ima where (ima_itemname LIKE @IMA_ItemID) end ">
                <SelectParameters>
                <asp:ControlParameter ControlID="RadioButtonList1" Name="QryType" PropertyName="SelectedValue" />
                <asp:ControlParameter ControlID="TextBox1" Name="IMA_ItemID" PropertyName="Text" />
                </SelectParameters>
                </asp:SqlDataSource>
                &nbsp;&nbsp;&nbsp;
                </div>
                </form>
                </body>
                </html>
                -------------------------------------
                I have tried all the solution given in this forum. Finally i m ended with this code. But all the code results are same. not giving any result.

                Anyhave thanks for showing interest to solve. It will be great help.
                Last edited by DrBunchman; Jun 9 '08, 01:26 PM. Reason: Added code tags - Please use the # button

                Comment

                Working...