Click here to Skip to main content
15,895,011 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

When i press F2 on textbox it should open gridview on new page(Child Page) and selected row on that gridview it should return values to textbox(Parent Page).

I tried but im getting values on Child Page not on Parent Page.
Pls Help.
My Code as follow:

RentalMaster.aspx
<script type="text/javascript">
function OpenPopup(objevent)
{
if (event.keyCode == 113)
{
document.onhelp = function () { return (false); }
window.onhelp = function () { return (false); }
window.open("ATMDetails_popup.aspx", "List", "scrollbars=no,resizable=yes,width=400,height=280");
}
}
</script>

<asp:TextBox ID="txtATMID" runat="server" onkeydown="OpenPopup(this)"></asp:TextBox>

RentalMaster.aspx.cs

protected void Page_Load(object sender, EventArgs e)
{
txtATMID.Text = Request.QueryString["ATMID"];
txtSiteType.Text = Request.QueryString["ATM_Type"];
txtBankName.Text = Request.QueryString["Bank"];
txtDeployedBy.Text = Request.QueryString["Remarks2"];
txtSiteLocation.Text = Request.QueryString["Location"];
txtSiteAddress.Text = Request.QueryString["ATM_Address"];
txtLiveDate.Text = Request.QueryString["Live_Date"];
txtAtmStatus.Text = Request.QueryString["ATM_status"];
}

ATMDetails_popup.aspx
<div>
<asp:SqlDataSource ID="ATMDetailsds" runat="server"
ConnectionString="<%$ ConnectionStrings:Connection %>"
SelectCommand="SELECT [ATMID], [ATM_Type], [Bank], [Remarks2], [Location], [ATM_Address], [Live_Date], [ATM_status] FROM [ATMMaster]">
</asp:SqlDataSource>
</div>
<div>
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="false" DataKeyNames="ATMID" DataSourceID="ATMDetailsds">
<Columns>
<asp:HyperLinkField DataNavigateUrlFields="ATMID, ATM_Type, Bank, Remarks2, Location, ATM_Address, Live_Date, ATM_Status"
DataNavigateUrlFormatString="RentalMaster.aspx?ATMID={0}&ATM_TYPE={1}&Bank={3}"
Text="SELECT" />
<asp:BoundField DataField="ATMID" HeaderText="ATMID" ReadOnly="True"
SortExpression="ATMID" />
<asp:BoundField DataField="ATM_Type" HeaderText="ATM_Type"
SortExpression="ATM_Type" />
<asp:BoundField DataField="Bank" HeaderText="Bank" SortExpression="Bank" />
<asp:BoundField DataField="Remarks2" HeaderText="Remarks2"
SortExpression="Remarks2" />
<asp:BoundField DataField="Location" HeaderText="Location"
SortExpression="Location" />
<asp:BoundField DataField="ATM_Address" HeaderText="ATM_Address"
SortExpression="ATM_Address" />
<asp:BoundField DataField="Live_Date" HeaderText="Live_Date"
SortExpression="Live_Date" />
<asp:BoundField DataField="ATM_status" HeaderText="ATM_status"
SortExpression="ATM_status" />
</Columns>
</asp:GridView>
</div>
Posted
Comments
ZurdoDev 26-Apr-13 7:48am    
Where are you stuck?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900