473,386 Members | 1,720 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Passing a value from a pop-up window to parent window in asp.net

My pop-up Window has this in a button click event:

Expand|Select|Wrap|Line Numbers
  1. string scriptString = "<script>javascript:window.opener.document.Form1.totalField.value =" + dNewTotalDue + "; javascript:window.opener.document.Form1.redeemField.value =" + dRedeemAmount + "; window.close();</script>";
  2. Page.RegisterStartupScript("Close", scriptString);
The variables: dNewTotalDue & dRedeemAmount are doubles

My Parent Window has this in a button click event:

Expand|Select|Wrap|Line Numbers
  1. Page.RegisterStartupScript("RedeemCard", "<script>javascript:window.open('" + redeemHwndUrl + "', 'RedeemCard', 'width=600,height=600,top=30,left=30,toolbars=no,scrollbars=no,status=no,resizable=no');</script>");
  2.  

This all worked fine when I was using an html page as the Parent window. But it stopped working when I decided to use an asp.net page as the parent window.

I also switched from using and html <input type="text"...> textbox to: <asp:textbox id="totalField" runat="server" Width="80px" MaxLength="20"></asp:textbox>

The pop-up works fine and I can pas values from the Parent to the pop-up. But when I click on the child window button, it does nothing. The pop-up does not close and the Parent window fields do not get populated with the dNewTotalDue & dRedeemAmount varaible values.

Any help would be much appreciated!
Oct 2 '10 #1
1 1709
acoder
16,027 Expert Mod 8TB
ASP.NET will probably be changing the id when it generates the text field. So,
- either check the source to see what the totalField ID looks like and use that instead,
- or you could use the ClientID property from ASP.NET to generate the JavaScript (probably the preferred option).

If you get stuck with the ASP.NET part, you can ask in the ASP.NET forum.
Oct 4 '10 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: monika | last post by:
hi ... I have an asp page which has 3 buttons. <p align="center"><input class="button" type="button" onClick="location='welStudent.asp';" value="Click to write a new story"></p> <p...
3
by: Lukelrc | last post by:
Hi all, I have an asp page with a delete button which has an OnClick Ok/Cancel msgbox event. My problem is that in order to run the Onclick event i've chaged the buttons type from "Submit" to...
2
by: Doug | last post by:
This should work, but I can't see the value when it hits the ASP code. I am trying to get the hang of this before moving forward with my project HTML code <form action="updTicket.asp"...
7
by: Mike | last post by:
I have to pass a date from a form to a report query. I have written a query that works fine when I execute from SQL view, But I dont know how to pass a value from the form to this query. SELECT...
2
by: Richard | last post by:
I'm trying to open a form based on the value that I am passing through to it. I'm trying to open the Deals form on the basis of a sellerid that I am trying to pass through to that second form. ...
1
by: Prabhua | last post by:
Can anyone help me out in solving this problem. i am passing a value i.e., Path, from radio button in asp function to javascript function.But while printing the value only words are seen and...
2
by: =?Utf-8?B?Um95?= | last post by:
Hi all, In a form I have a text called myText as input and need to pass its value to the next page (mySecond.asp) The following works fine and my next page I get the value of myText=test: <a...
2
by: Larry | last post by:
anyone have an example of passing a value from a radio button to a JavaScript function in ASP.net? <input type="radio" value="text_play" name="play_type" checked="checked" /> this is the type...
4
idsanjeev
by: idsanjeev | last post by:
SIR I AM PASSING VALUE FROM ONE FORM TO ANOTHER FORM THROUGH COOKIES BUT IS CAN ONLY TRANSFER LAST VALUE HOW CAN PASS VALUE AFTER CLICKIN ON LINK I AM USING THE CODE IS FOR LINK <td><a...
8
by: Amera | last post by:
hello, i have tried alot of things about this but in the end i did it using flat file. but the response is so slow -_-" i'm passing a character between C and C# using a text file. this...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.