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>