473,385 Members | 1,912 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 do I postback values to another page?

I want to click a button on page 1 and have a page 2 open. Page 2 is a
lookup and should return the value and text back to the page 1 and close.
On page 2 I set the postbackURL to page1 and when I click the close button
the current page (which should close) loads page1. How do I send the value
and text of page 2 back to page 1 form fields?
Nov 19 '05 #1
2 1029
Store in cache is one option; you then pull back from cache in Page1. If this
is all in a single trip to the server, you can also work with the collection
of the prior page, although it is a royal pain in Framework 1.1 (2.0 gives
much better options here).
---

Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

***************************
Think Outside the Box!
***************************

"Harold" wrote:
I want to click a button on page 1 and have a page 2 open. Page 2 is a
lookup and should return the value and text back to the page 1 and close.
On page 2 I set the postbackURL to page1 and when I click the close button
the current page (which should close) loads page1. How do I send the value
and text of page 2 back to page 1 form fields?

Nov 19 '05 #2
This is what I did. On page B with the treeview I added a HTML Button, and 2
hidden asp.net fields to the page.
<input id="btnClose" type="button" value="Close" onclick="postdata();" />

<input id="hOrgText" type="hidden" runat=server />

<input id="hOrgVal" type="hidden" runat=server />

Sub TreeView_Select(ByVal sender As Object, ByVal e As EventArgs)

'Set the hidden forms fields so javascript can send the values back to
calling page.

hOrgText.Value = TreeView1.SelectedNode.Text

hOrgVal.Value = TreeView1.SelectedNode.Value

End Sub

<script type="text/javascript">

function postdata(){

top.opener.document.forms[0].elements["txtOrg"].value =
document.forms[0].item("hOrgText").value;

top.opener.document.forms[0].elements["hidOrg"].value =
document.forms[0].item("hOrgVal").value;

window.close();
}

</script>

Now I can post the variables back to the calling page without reloading it.

I tried this which didn't work for me. Someone can tell me why.
top.opener.document.forms[0].elements["hidOrg"].value = <%="somevalue" %>;

"Cowboy (Gregory A. Beamer) - MVP" <No************@comcast.netNoSpamM> wrote
in message news:5F**********************************@microsof t.com...
Store in cache is one option; you then pull back from cache in Page1. If
this
is all in a single trip to the server, you can also work with the
collection
of the prior page, although it is a royal pain in Framework 1.1 (2.0 gives
much better options here).
---

Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

***************************
Think Outside the Box!
***************************

"Harold" wrote:
I want to click a button on page 1 and have a page 2 open. Page 2 is a
lookup and should return the value and text back to the page 1 and close.
On page 2 I set the postbackURL to page1 and when I click the close
button
the current page (which should close) loads page1. How do I send the
value
and text of page 2 back to page 1 form fields?

Nov 19 '05 #3

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

Similar topics

5
by: John W | last post by:
Hello, I have been wondering that everytime I do a submit on a button/form (postback) it is using the same webform on the CS, how do I goto another webform once I have done a postback and...
10
by: Krista Lemieux | last post by:
I'm new to ASP.NET and I'm not use to the way things are handled with this technology. I've been told that when I have a control, I should only bind the data to it once, and not on each post back...
8
by: stephen | last post by:
Hi, I make use of properties to store values that are relevant to the page but this time I am posting the page to itself and the values are Zero or null (they disappear). is there any other way...
2
by: =?Utf-8?B?SlA=?= | last post by:
Hi all. I'm having a problem with a postback issue and I think it's cache related. Here's my setup: I have a web site that has a signup section. This has simple things like name, age, birth...
2
by: =?Utf-8?B?TG91aXNhOTk=?= | last post by:
Hello. ive just read some posts on the age old issue of losing dynamic control values on postback. Most people say recreate the controls on the onInit, but i just dont think this serves my purpose....
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:
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
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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.