Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C# ASP.NET
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 25-Apr-13 23:05pm
Comments
ryanb31 at 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)

  Print Answers RSS
0 Mathew Soji 334
1 Maciej Los 295
2 BillWoodruff 290
3 Afzaal Ahmad Zeeshan 257
4 DamithSL 225
0 OriginalGriff 6,369
1 Sergey Alexandrovich Kryukov 5,973
2 DamithSL 5,183
3 Manas Bhardwaj 4,673
4 Maciej Los 4,045


Advertise | Privacy | Mobile
Web04 | 2.8.1411019.1 | Last Updated 26 Apr 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100