Showing posts with label following. Show all posts
Showing posts with label following. Show all posts

Monday, March 26, 2012

Passing values from one page to another

I have a Page1.htm with the following code:

<HTML>
<frameset cols="40%,*" >
<frame name="LeftFrame" src='Page2.aspx?Table=??' >
<frame name="RightFrame" >
</frameset>
</HTML
Page1.htm was called using Page1.htm?Table=Users.

I don't know the syntax of how to pass the value of the parameter "Table" onto the second page I'm loading on the LeftFrame, using request.querystring( "Table" ).

I apprecciate any help.

Mosheuse the following:

<frame name="LeftFrame" src='Page2.aspx?Table=<% Response.Write(Request.QueryString("Table"));%>'
Moshe & Sachin

Thanks for your contribution Sachin but the suggestion will not work as it basically an static HTM page as Moshe wrote "I have a Page1.htm with ..." Therfore Response.Write(Request.QueryString("Table")) can't be performed there! An static page would not be able to process this directive. However, the frame file Page2.aspx is able to process all server side code like a normal ASP.NET page.

If you go like src='Page2.aspx?Table=myTable', this will do as its an static parameter. However you can always parse this using java script (it works in static HTML). Try this article
http://www.eggheadcafe.com/articles/20020107.asp

OR make page1.htm (main page) a webform (aspx file) i.e. page1.aspx and this will do as well.

Hope it helps.

-Adnan Masood
Sachin & Adnan,

Thanks very much for the information.

For now I'm implementing the solution keeping Page1.htm as it is and not as a web form, I went to the article Adnan recommended and I already have a function called "queryString()" that is working and returning the value for the parameter "Table" correctly.

Please tell me how to insert the value returned by the javascript function "queryString()" in the code:

<frame name="LeftFrame" src='Page2.aspx?Table=??'
Thanks,
Moshe

Saturday, March 24, 2012

Passing Variables between web forms

Hi There,
My question is as following,
I have a webform (Webform1) which contains one label control and command
button, when the user clicks the button another webform (Webform2) appears,
webform2 contains only one control which is the Calendar control, I want to
do the following
1- when the user selects a date from the webforms, I want the value
(selected date) appears in the label control in the webform1
2- Webform2 to be closed automatically after the date selection
Kind regards and thanks in advancesearch MSDN for showModalDialog method. That will do just what you're
looking for.
Dale
"Aitham alama" <h_salama@.yahoo.com> wrote in message
news:eSfH8gcZEHA.3716@.TK2MSFTNGP11.phx.gbl...
> Hi There,
> My question is as following,
> I have a webform (Webform1) which contains one label control and command
> button, when the user clicks the button another webform (Webform2)
appears,
> webform2 contains only one control which is the Calendar control, I want
to
> do the following
> 1- when the user selects a date from the webforms, I want the value
> (selected date) appears in the label control in the webform1
> 2- Webform2 to be closed automatically after the date selection
> Kind regards and thanks in advance
>

Passing Variables between web forms

Hi There,

My question is as following,

I have a webform (Webform1) which contains one label control and command
button, when the user clicks the button another webform (Webform2) appears,
webform2 contains only one control which is the Calendar control, I want to
do the following

1- when the user selects a date from the webforms, I want the value
(selected date) appears in the label control in the webform1
2- Webform2 to be closed automatically after the date selection

Kind regards and thanks in advancesearch MSDN for showModalDialog method. That will do just what you're
looking for.

Dale

"Aitham alama" <h_salama@.yahoo.com> wrote in message
news:eSfH8gcZEHA.3716@.TK2MSFTNGP11.phx.gbl...
> Hi There,
> My question is as following,
> I have a webform (Webform1) which contains one label control and command
> button, when the user clicks the button another webform (Webform2)
appears,
> webform2 contains only one control which is the Calendar control, I want
to
> do the following
> 1- when the user selects a date from the webforms, I want the value
> (selected date) appears in the label control in the webform1
> 2- Webform2 to be closed automatically after the date selection
> Kind regards and thanks in advance

passing variables between two different windows

Hello. I'm a rookie ASP VBScripter and am having a difficult time scripting
the following scenario:

I have an index.asp file that has a multi-line text box and a button of type
button. When the button is clicked a window is spawned with change.asp as
its source. There is a form with a few text boxes and with a button of type
submit and a cancel button of type button that just closes the window. What
I want to happen is I want the information entered in change.asp to be added
into the multi-line text box in index.asp when the submit button is clicked
in change.asp. Here are the index.asp and change.asp files:

//--index.asp----
<html>
<head>
<title>Product Listing</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head
<script language="JavaScript" type="text/javascript">
self.moveTo(0,0);
self.resizeTo(screen.availWidth,screen.availHeight );
function changeInfo()
{
var x = (screen.width - 400) / 2;
var y = (screen.height - 320) / 2;
var myWin = window.open("change.asp",null,"scrollbars=no, toolbar=no,
resizable=no, width=400, height=300, left="+x+" top="+y)
}
</script
<body>
<table width="554" cellpadding="5">
<tr>
<td width="400"><img src="http://pics.10026.com/?src=images/HouseValue 031.jpg" width="400"
height="300"></td>
<td width="3027" valign="top"><form name = "picInfo" id = "picInfo">
<textarea name="txtInfo" id="txtInfo" cols="40" rows="10"
wrap="soft" readonly>Press "Change" to enter information.</textarea>
<br>
<input type="button" value="Change" id="btnChange" name="btnChange"
onClick="javascript:changeInfo()">
</form></td>
</tr>
</table>
</body>
</html>
//-----------
//---change.asp------
<html>
<head>
<title>Edit Product Description</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<script language="JavaScript" type="text/javascript">
function Cancel()
{
window.close();
}
</script>
<body>
<form name="frmChange" id="frmChange" method="post">
<table>
<tr>
<td align="right">Product Name:</td>
<td align="left"><input type="text" name="txtProduct" id="txtProduct"
size="40"></td>
</tr>
<tr>
<td align="right">Model #:</td>
<td align="left"><input type="text" name="txtModel" id="txtModel"
size="40"></td>
</tr>
<tr>
<td align="right">Value:</td>
<td align="left"><input type="text" name="txtValue" id="txtValue"></td>
</tr>
<tr>
<td align="right">Category:</td>
<td align="left"><select name="mnuCategory" id="mnuCategory">
<option selected value="NULL">Choose category...</option>
<option value="Furniture">Furniture</option>
<option value="Electronics">Electronics</option>
<option value="Home Media">Home Media</option>
<option value="Jewlery">Jewlery</option>
</select></td>
</tr>
<tr>
<td align="right" valign="top">Misc. Information:</td>
<td align="left"><textarea name="txtMisc" id="txtMisc" cols="30"
rows="5"></textarea></td>
</tr>
</table>
<br>
<center>
<input type="submit" name="btnSubmitChanges" id="btnSubmitChanges"
value="Submit">
<input type="button" name="btnCancel" id="btnCancel" value="Cancel"
onClick="javascript:Cancel()">
</center>
</form>
</body>
</html>
//--------

I've been messing with it for a day now and I have been unable to pass
variables from change.asp into index.asp. Any help would be much
appreciated.

~Les PeabodySounds like you'll be needing to use some client side javascript.
You can open a new window using javascript such as this:
a=window.open('MyPage.aspx','_new')
There are all kinds of options for setting window properties such as window
size and toolbar visibility.
Here's more info:
http://msdn.microsoft.com/workshop/...hods/open_0.asp

From that new window you can reference the original parent window with
this javascript reference:

Here's an example:
window.opener.document.form1.mytextbox.value = 'whatever';

Here's more info:
http://www.mozilla.org/docs/dom/dom...ndow_ref77.html

--
I hope this helps,
Steve C. Orr, MCSD
http://Steve.Orr.net
Hire top-notch developers at http://www.able-consulting.com

"Les Peabody" <les.peabody@.geo-sync.com> wrote in message
news:eGyXyv62DHA.1184@.TK2MSFTNGP10.phx.gbl...
> Hello. I'm a rookie ASP VBScripter and am having a difficult time
scripting
> the following scenario:
> I have an index.asp file that has a multi-line text box and a button of
type
> button. When the button is clicked a window is spawned with change.asp as
> its source. There is a form with a few text boxes and with a button of
type
> submit and a cancel button of type button that just closes the window.
What
> I want to happen is I want the information entered in change.asp to be
added
> into the multi-line text box in index.asp when the submit button is
clicked
> in change.asp. Here are the index.asp and change.asp files:
> //--index.asp----
> <html>
> <head>
> <title>Product Listing</title>
> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
> </head>
> <script language="JavaScript" type="text/javascript">
> self.moveTo(0,0);
> self.resizeTo(screen.availWidth,screen.availHeight );
> function changeInfo()
> {
> var x = (screen.width - 400) / 2;
> var y = (screen.height - 320) / 2;
> var myWin = window.open("change.asp",null,"scrollbars=no, toolbar=no,
> resizable=no, width=400, height=300, left="+x+" top="+y)
> }
> </script>
> <body>
> <table width="554" cellpadding="5">
> <tr>
> <td width="400"><img src="http://pics.10026.com/?src=images/HouseValue 031.jpg" width="400"
> height="300"></td>
> <td width="3027" valign="top"><form name = "picInfo" id = "picInfo">
> <textarea name="txtInfo" id="txtInfo" cols="40" rows="10"
> wrap="soft" readonly>Press "Change" to enter information.</textarea>
> <br>
> <input type="button" value="Change" id="btnChange" name="btnChange"
> onClick="javascript:changeInfo()">
> </form></td>
> </tr>
> </table>
> </body>
> </html>
> //-----------
> //---change.asp------
> <html>
> <head>
> <title>Edit Product Description</title>
> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
> </head>
> <script language="JavaScript" type="text/javascript">
> function Cancel()
> {
> window.close();
> }
> </script>
> <body>
> <form name="frmChange" id="frmChange" method="post">
> <table>
> <tr>
> <td align="right">Product Name:</td>
> <td align="left"><input type="text" name="txtProduct" id="txtProduct"
> size="40"></td>
> </tr>
> <tr>
> <td align="right">Model #:</td>
> <td align="left"><input type="text" name="txtModel" id="txtModel"
> size="40"></td>
> </tr>
> <tr>
> <td align="right">Value:</td>
> <td align="left"><input type="text" name="txtValue" id="txtValue"></td>
> </tr>
> <tr>
> <td align="right">Category:</td>
> <td align="left"><select name="mnuCategory" id="mnuCategory">
> <option selected value="NULL">Choose category...</option>
> <option value="Furniture">Furniture</option>
> <option value="Electronics">Electronics</option>
> <option value="Home Media">Home Media</option>
> <option value="Jewlery">Jewlery</option>
> </select></td>
> </tr>
> <tr>
> <td align="right" valign="top">Misc. Information:</td>
> <td align="left"><textarea name="txtMisc" id="txtMisc" cols="30"
> rows="5"></textarea></td>
> </tr>
> </table>
> <br>
> <center>
> <input type="submit" name="btnSubmitChanges" id="btnSubmitChanges"
> value="Submit">
> <input type="button" name="btnCancel" id="btnCancel" value="Cancel"
> onClick="javascript:Cancel()">
> </center>
> </form>
> </body>
> </html>
> //--------
> I've been messing with it for a day now and I have been unable to pass
> variables from change.asp into index.asp. Any help would be much
> appreciated.
> ~Les Peabody
That worked great, I figured there would be a way to access the parent
window. Thanks Steve.

~Les Peabody

"Steve C. Orr [MVP, MCSD]" <Steve@.Orr.net> wrote in message
news:%23tVzF162DHA.1752@.tk2msftngp13.phx.gbl...
> Sounds like you'll be needing to use some client side javascript.
> You can open a new window using javascript such as this:
> a=window.open('MyPage.aspx','_new')
> There are all kinds of options for setting window properties such as
window
> size and toolbar visibility.
> Here's more info:
http://msdn.microsoft.com/workshop/...hods/open_0.asp
> From that new window you can reference the original parent window with
> this javascript reference:
> Here's an example:
> window.opener.document.form1.mytextbox.value = 'whatever';
> Here's more info:
> http://www.mozilla.org/docs/dom/dom...ndow_ref77.html
> --
> I hope this helps,
> Steve C. Orr, MCSD
> http://Steve.Orr.net
> Hire top-notch developers at http://www.able-consulting.com
>
> "Les Peabody" <les.peabody@.geo-sync.com> wrote in message
> news:eGyXyv62DHA.1184@.TK2MSFTNGP10.phx.gbl...
> > Hello. I'm a rookie ASP VBScripter and am having a difficult time
> scripting
> > the following scenario:
> > I have an index.asp file that has a multi-line text box and a button of
> type
> > button. When the button is clicked a window is spawned with change.asp
as
> > its source. There is a form with a few text boxes and with a button of
> type
> > submit and a cancel button of type button that just closes the window.
> What
> > I want to happen is I want the information entered in change.asp to be
> added
> > into the multi-line text box in index.asp when the submit button is
> clicked
> > in change.asp. Here are the index.asp and change.asp files:
> > //--index.asp----
> > <html>
> > <head>
> > <title>Product Listing</title>
> > <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
> > </head>
> > <script language="JavaScript" type="text/javascript">
> > self.moveTo(0,0);
> > self.resizeTo(screen.availWidth,screen.availHeight );
> > function changeInfo()
> > {
> > var x = (screen.width - 400) / 2;
> > var y = (screen.height - 320) / 2;
> > var myWin = window.open("change.asp",null,"scrollbars=no, toolbar=no,
> > resizable=no, width=400, height=300, left="+x+" top="+y)
> > }
> > </script>
> > <body>
> > <table width="554" cellpadding="5">
> > <tr>
> > <td width="400"><img src="http://pics.10026.com/?src=images/HouseValue 031.jpg" width="400"
> > height="300"></td>
> > <td width="3027" valign="top"><form name = "picInfo" id = "picInfo">
> > <textarea name="txtInfo" id="txtInfo" cols="40" rows="10"
> > wrap="soft" readonly>Press "Change" to enter information.</textarea>
> > <br>
> > <input type="button" value="Change" id="btnChange" name="btnChange"
> > onClick="javascript:changeInfo()">
> > </form></td>
> > </tr>
> > </table>
> > </body>
> > </html>
> > //-----------
> > //---change.asp------
> > <html>
> > <head>
> > <title>Edit Product Description</title>
> > <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
> > </head>
> > <script language="JavaScript" type="text/javascript">
> > function Cancel()
> > {
> > window.close();
> > }
> > </script>
> > <body>
> > <form name="frmChange" id="frmChange" method="post">
> > <table>
> > <tr>
> > <td align="right">Product Name:</td>
> > <td align="left"><input type="text" name="txtProduct" id="txtProduct"
> > size="40"></td>
> > </tr>
> > <tr>
> > <td align="right">Model #:</td>
> > <td align="left"><input type="text" name="txtModel" id="txtModel"
> > size="40"></td>
> > </tr>
> > <tr>
> > <td align="right">Value:</td>
> > <td align="left"><input type="text" name="txtValue" id="txtValue"></td>
> > </tr>
> > <tr>
> > <td align="right">Category:</td>
> > <td align="left"><select name="mnuCategory" id="mnuCategory">
> > <option selected value="NULL">Choose category...</option>
> > <option value="Furniture">Furniture</option>
> > <option value="Electronics">Electronics</option>
> > <option value="Home Media">Home Media</option>
> > <option value="Jewlery">Jewlery</option>
> > </select></td>
> > </tr>
> > <tr>
> > <td align="right" valign="top">Misc. Information:</td>
> > <td align="left"><textarea name="txtMisc" id="txtMisc" cols="30"
> > rows="5"></textarea></td>
> > </tr>
> > </table>
> > <br>
> > <center>
> > <input type="submit" name="btnSubmitChanges" id="btnSubmitChanges"
> > value="Submit">
> > <input type="button" name="btnCancel" id="btnCancel" value="Cancel"
> > onClick="javascript:Cancel()">
> > </center>
> > </form>
> > </body>
> > </html>
> > //--------
> > I've been messing with it for a day now and I have been unable to pass
> > variables from change.asp into index.asp. Any help would be much
> > appreciated.
> > ~Les Peabody