one help pleaseProblem is
i have two web forms
1. ForiegnkeyTest.aspx
2. foroginkeytable.aspx
step 1 1 ForiegnkeyTest.aspx one web form
<head runat="server">
<script language="javascript" type="text/javascript">
function popWin()
{
var confirmWin = null;
confirmWin = window.open('foroginkeytable.aspx','anycontent', 'width=455,height=435,status');
}
</script>< <asp:TextBox ID="txtaeropuerto" runat="server" CssClass="txtBox" MaxLength="3" Width="85px"></asp:TextBox></div>
<br />
<br />
<input type="button" onClick="popWin()" value="Open Window">
step2 . foroginkeytable.aspx ( tiena una listbox cargando sobre base de datos<div>
<asp:DropDownList ID="txtciudad" runat="server" CssClass="dropdown" DataSourceID="SqlDataSourceCIUDAD"
DataTextField="CIUDAD" DataValueField="CIUDAD" Width="90px">
</asp:DropDownList>
<asp:SqlDataSource ID="SqlDataSourceCIUDAD" runat="server" ConnectionString="<%$ ConnectionStrings:PortalPaxNTv10 %>"
SelectCommand="SELECT [CIUDAD] FROM [PP_CIUDAD]"></asp:SqlDataSource>
<input id="Button1" type="button" value="loadtextbox" />
</div>
</form>
NOW question is ......
when i select the list item of listbox of web from foroginkeytable.aspx ,and click buuton accept Button1 , the selcted item
should be get loaded in textbox of txtaeropuerto of another web form ForiegnkeyTest.aspx, and web form foroginkeytable.aspx get closed
automatically after this eventso can you send me any code logic or web refrence or any hint to this problem
rest is fine
waitingwarm regards
virender singh
Virender singh
MCA, CCNA
System Analyst
virender.singh@panel.es
unisys.vsingh@iberia.es
Virender.Singh@es.unisys.com
VISION IS FUTURE
Madrid( Spain)
![]() |
-1 |
![]() |
Hi virender,
What I should do is the following. I should work with a SessionVariable.
Ok, so you have your table.aspx (the popup) and the test.aspx ( the opener).
What should all be set:
function closePopupAndReloadOpener() { if (opener && !opener.closed) { opener.location.reload(); } window.close(); }
Please give it a try!
If you have further questions or remarks I'd like to hear them.
Greetz,
Wim
![]() |
0 |
![]() |
u can use window.opener to access the textbox in the parent window to set the value of textbox before closing the window and if id of textbox is dynamically generated send it in the query string to the popup page
Regards,
Hossam El-Deen M. Barakat
Microsoft Certified Technology Specialist(Web, Windows)
Blog: http://HossamElDeen.blogspot.com
![]() |
2 |
![]() |
hello Greetz,
Wim1. to avoid null error reference i have done this in ForiegnkeyTest c# file
protected void Page_Load(object sender, EventArgs e){
if( Page.Request.QueryString["IdAeropuerto"]!=null)txtaeropuerto.Text = Page.Request.QueryString["IdAeropuerto"].ToString();2.now opened pòpup like this
protected void Button2_Click(object sender, EventArgs e) //// Button2 type run on server{
Button2.Attributes.Add("onclick", "window.open('foroginkeytable.aspx',null,'height=400, width=400,status= no, resizable= no, scrollbars=no, toolbar=no,location=no,menubar=no ');");}
3.,protected void Button2_Click(object sender, EventArgs e){
Response.Redirect("foroginkeytable.aspx?IdAeropuerto=" + txtciudad.SelectedValue.ToString(),true);}
4 . now it is not refelcting in txtaeropuerto.Text of ForiegnkeyTes.aspx file , ??????, there is no error like comilation error
please clear me last two points of your reply and advise me how to load this txtaeropuerto.Text of ForiegnkeyTest.aspx file
any idea ??????
regards
Virender singh
MCA, CCNA
System Analyst
virender.singh@panel.es
unisys.vsingh@iberia.es
Virender.Singh@es.unisys.com
VISION IS FUTURE
Madrid( Spain)
![]() |
1 |
![]() |
Hello please tell me code example
how to implement this concept with session varriables, astxtaeropuerto.Text not geeting suppied value
txtaeropuerto.Text = Page.Request.QueryString["IdAeropuerto"].ToString(); ???by this eventButton1.Attributes.Add(
"OnClick", "return window.open('foroginkeytable.aspx');");Response.Redirect(
"foroginkeytable.aspx?IdAeropuerto=" + txtciudad.SelectedValue.ToString(), true);as it is op up window???? or some anotjher reason
how to impelement with session variable please advise me
lof thanks in advance for support
regards
Virender singh
MCA, CCNA
System Analyst
virender.singh@panel.es
unisys.vsingh@iberia.es
Virender.Singh@es.unisys.com
VISION IS FUTURE
Madrid( Spain)
![]() |
1 |
![]() |
Hello i got sucess to achieve with session varriable LOT OF thanks for support
public partial class ForiegnkeyTest : System.Web.UI.Page{
protected void Page_Load(object sender, EventArgs e){
Page.MaintainScrollPositionOnPostBack =
true; if (Page.Session["IdAeropuerto"]!= null)txtaeropuerto.Text = Session["IdAeropuerto"].ToString();Session.Remove(
"IdAeropuerto");break;}
}
protected void Button1_Click(object sender, EventArgs e)
{
Button1.Attributes.Add("OnClick", "return window.open('foroginkeytable.aspx');");}
****************************foroginkeytable
.aspx c#.net source web form ***************protected void Button2_Click(object sender, EventArgs e){
try{
Session["IdAeropuerto"] = txtciudad.SelectedValue.ToString(); Server.Transfer("ForiegnkeyTest.aspx");
}
catch (HttpException exp){
}
}
NOW its functioning thanks for IDEA
http://www.dotnetbips.com/articles/displayarticledetails.aspx?articleid=79
Virender singh
MCA, CCNA
System Analyst
virender.singh@panel.es
unisys.vsingh@iberia.es
Virender.Singh@es.unisys.com
VISION IS FUTURE
Madrid( Spain)
![]() |
-1 |
![]() |