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?