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

Passing property values from popup to Main Webform?

VMI
How can I pass variable or Property values from my popup webForm to the
webform that opened this popup?
For information that's in a control (i.e. Textbox), I'm using javascript and
document.getElementById:

var variable = document.getElementById('txtBox).value;

But if the control is hidden, that javascript code generates an error. Can
this be done with properties?
Thanks.
Oct 11 '06 #1
5 1725
"VMI" <VM*@discussions.microsoft.comwrote in message
news:D8**********************************@microsof t.com...
How can I pass variable or Property values from my popup webForm to the
webform that opened this popup?
http://msdn.microsoft.com/library/de...odaldialog.asp
For information that's in a control (i.e. Textbox), I'm using javascript
and
document.getElementById:

var variable = document.getElementById('txtBox).value;
I'm assuming that the missing apostrophe after txtBox is just a typo...?
But if the control is hidden, that javascript code generates an error.
Sigh - WHAT ERROR DOES IT GENERATE?
Can this be done with properties?
Yes.
Oct 11 '06 #2
there is hidden (type=hidden) and invisible. javascript can see hidden
fields. fields marked invisible are not render, so the brwser does not see
them.

-- bruce (sqlwork.com)

"VMI" <VM*@discussions.microsoft.comwrote in message
news:D8**********************************@microsof t.com...
How can I pass variable or Property values from my popup webForm to the
webform that opened this popup?
For information that's in a control (i.e. Textbox), I'm using javascript
and
document.getElementById:

var variable = document.getElementById('txtBox).value;

But if the control is hidden, that javascript code generates an error. Can
this be done with properties?
Thanks.


Oct 11 '06 #3
VMI
Thanks for the post. Sorry about the vague post.
The missing apostrophe was just a typo when I posted the message.
The error I get when I try to get the server-side textBox value (when
visible= false) is "Object Requred". If I make it visible, it works. The
problem is that this information doesn't need to be displayed.
I'm using server-side textboxes because they interact with a gridview and I
feel more comfortable with them. So I can't use (Type= hidden).
How can this be done with properties instead of retrieving the value of the
Textbox?
Thanks.

"Mark Rae" wrote:
"VMI" <VM*@discussions.microsoft.comwrote in message
news:D8**********************************@microsof t.com...
How can I pass variable or Property values from my popup webForm to the
webform that opened this popup?

http://msdn.microsoft.com/library/de...odaldialog.asp
For information that's in a control (i.e. Textbox), I'm using javascript
and
document.getElementById:

var variable = document.getElementById('txtBox).value;

I'm assuming that the missing apostrophe after txtBox is just a typo...?
But if the control is hidden, that javascript code generates an error.

Sigh - WHAT ERROR DOES IT GENERATE?
Can this be done with properties?

Yes.
Oct 11 '06 #4
Try this.

<asp:TextBox style="display:none" runat="server"
ID="txtTest"></asp:TextBox>

It will still render and your javascript will work as expected.

Oct 11 '06 #5
Yes, I agree with Gozirra.

Some more information: for server-side textboxes, if you set the
Visible property = false, then asp.net tries to be "smart" and does not
render the text box at all. This is not what you want and is
completely different from rendering a textbox that is not visible.

Three common ways to solve your issue:
1) CSS Solution: Like Gozirra said, use the display:none style
2) Asp.Net 1.1 Solution: In the code-behind, use
"Attributes.Add(visible, false)". This will set the html visible
property to false, not the ASP.Net Visible property.
3) Asp.Net 2.0 Solution: Asp.net 2.0 has a new control to solve this
issue called: <asp:hiddenfield>. This is probably the preferred way
to do it in asp.net 2.0. Microsoft created the hiddenfield control to
solve the problem you are having. Use a HiddenField control instead of
a TextBox.

Oct 11 '06 #6

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

Similar topics

4
by: Job Lot | last post by:
How would I send information from DataGrid on the main form of the application to a modal popup form and then pass any changes to the data back to the main form and database when the popup form was...
1
by: Newbie | last post by:
Hi! How do I pass strings between webforms using Request in the target webform but without using Response.Redirect("SearchPOs.aspx?vendorName=" + vendorName); in the source webform. This is...
8
by: Mike Fellows | last post by:
Ok, im not sure if this is at all possible and if it is how i go about it is beyond me i have a piece of client side code that requires a piece of data from the server side (an ID number in this...
1
by: billy | last post by:
Ok, here's the situation... I have a user control that contains two textboxes (one for a from date/time and one for a to date/time) and two image buttons. The user control itself is supposed to...
0
by: Peter | last post by:
Does any one has an example of how do I retrieve values from a PopUp Window. The popup windows is an ASP.NET webform and it is displayed when user clicks on a html button. How do I retrieve...
3
by: Aaron | last post by:
I am having a little difficulty with a relatively simple task. I have a parent webform. I have a javascript attribute added to a button to open a new window when clicked. The user fills in a...
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...
4
by: RipperT | last post by:
College newbie here (Instructor MIA). I have instructions to pass variable values from one web page to another like this (VS2005): 1. Declare and create the properties on the first page (source...
2
by: ruca | last post by:
Hi, Can anyone tell me please how can I return values from a popup to a UserControl. I use the same "method" like to return to a WebForm, but it not works in UserControl case. I have 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:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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: 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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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.