Suchinthaka
Suchinthaka

Reputation:

redirect to the same page without changes in that page

i have a web page with a hyperlink that set target to a _blank page. In that page if i click a button i need to get the text generate in that button to the previous page without changing the details on the previous page.

this is the parent text code.

<asp:TextBox id="txtMatId" runat="server" ></asp:TextBox>

target _blank page code;
 <asp:GridView id="grdMaterial" runat="server" AllowPaging="True" BackColor="Lime" DataKeyNames="item_Id" AutoGenerateColumns="False" 
                                    BorderColor="Red" OnSelectedIndexChanged="grdMaterial_SelectedIndexChanged">
                                    <Columns>
<asp:TemplateField><ItemTemplate>
<asp:LinkButton id="lnkSelect" onclick="lnkSelect_Click" runat="server" __designer:wfdid="w102" PostBackUrl="~/Merchandiser/MNewOrder.aspx">Select</asp:LinkButton>
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField DataField="item_Id" HeaderText="Item Id"></asp:BoundField>
<asp:TemplateField><ItemTemplate>
<asp:Image id="imgItemImage" runat="server" ImageeUrl='<%# Eval("mat_Image") %>'  ></asp:Image> 
</ItemTemplate>
</asp:TemplateField>
</Columns>

                                </asp:GridView>

want to redirect to the parent page by setting the itemid value to the parent page text field without changing the selected dropdownlist values.

Upvotes: 0

Views: 545

Answers (1)

TheVillageIdiot
TheVillageIdiot

Reputation: 40497

Suppose you have a text box which you want to populate from popup page.

parent page:

<input type="text" id="dynamic" />
<a href="PopUp.html" target="_blank">Open Window</a>

child page:

<input type="text" id="userInput"/>
<input type="button" id="btn1" onclick="FillValue()" value="Click"/>

<script type="text/javascript">
    function FillValue()
    {
         window.opener.dynamic.value=document.getElementById("userInput").value;
         window.close();
    }
</script>

Upvotes: 1

Related Questions