473,385 Members | 1,379 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,385 software developers and data experts.

How to get HtmlInputHidden value in a popup window?

In page1:<INPUT id="MD" type="hidden" name="MD" value="Hello world">,
and there is a button, has a javascript onclick event, in this event, a
popup window will appear.

In the pop-up window, how can I get the hidden control's value (Hello
world) in code behind?
BTW, I can get it in clicent by:
var MDValue = window.opener.document.getElementById("MD").value;

Nov 28 '05 #1
4 1552
You have to pass that as a querystring parameter to the popup, then the
code-behind can access it.

"Jack" <ls*****@gmail.com> wrote in message
news:11**********************@g14g2000cwa.googlegr oups.com...
In page1:<INPUT id="MD" type="hidden" name="MD" value="Hello world">,
and there is a button, has a javascript onclick event, in this event, a
popup window will appear.

In the pop-up window, how can I get the hidden control's value (Hello
world) in code behind?
BTW, I can get it in clicent by:
var MDValue = window.opener.document.getElementById("MD").value;

Nov 28 '05 #2
I know I can access via querystring, but what I need is:
The page can only be opened in my way, never display information if
user input the link in the addressbar, then click "enter".

Nov 28 '05 #3
For the popup to be the information, the accepted way is to use the
querystring. A popup is nothing more than a page, and there is little you
can do to prevent the user from loading it manually.

Now, if you want to be tricky, you could always do a postback for your
button and then use something like RegisterStartupScript to inject the
showModelDialog function. This way you can store the field value in a
session variable and use this to verify they came from the correct place.
You can also check the Referer header field to make sure they came from your
page.

"Jack" <ls*****@gmail.com> wrote in message
news:11*********************@z14g2000cwz.googlegro ups.com...
I know I can access via querystring, but what I need is:
The page can only be opened in my way, never display information if
user input the link in the addressbar, then click "enter".

Nov 28 '05 #4
The 2 sites are different, Session doesn't work in this case.
I'm using javascript to control it,
if( window.opener == null )
// window.location = "xxxx";

but it isn't safe anyway.

Nov 30 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: toufik toufik | last post by:
Hi, I'm using the folowing javascript code to oprn a popUp window msgWindow=window.open('','messageWindow', 'scrollbars=yes,width=300, height=150'); msgWindow.document.open();...
1
by: Tony Farrell | last post by:
Hi Everyone - I have a data entry form that allows the user to click a button and have that button popup a list of available values - the code on the popup window uses the name of the form to...
4
by: Davey | last post by:
I have a website which has a popup window (this only opens when the user chooses to open it). In the popup window I have a <select> control which lists a selection of "classes". Each class has a...
4
by: wrytat | last post by:
I have a form with a textbox for the user to enter a quantity and another textbox for the delivery date. I disabled this delivery date textbox such that the user has to press a calendar link next...
6
by: heybrakywacky | last post by:
After hours of pulling my hair out on this one, I've finally realized that the problem I'm having in my code is due to behavior that is not at all expected. Using ASP.NET 1.1.4322.2032, I'm...
1
by: ABC | last post by:
I has a parent and a popup lookup ASP.NET Form. Both has javascript. I test the popup window's window.Form1.SelectedProductCode.value has a value. But don't know why the return variable "retvar"...
5
by: knowdotnet | last post by:
Hi all, Which is the best way to return a value back to the web page from a pop up page? I have a asp.net web application which opens a popup page on a link button click. The Link button is...
4
by: neena | last post by:
Hi I am uing C#.net & using javacript for a popup window. I've a form and there is a button named Categories. When it is clicked, it will open a new window for the selection of categories. When...
1
by: VMI | last post by:
How can I transfer some text from a Textbox in a popup window to the main webform that opened that popup? The popup webform will have some type of Button that the user will click in order to...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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...

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.