468,484 Members | 2,032 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,484 developers. It's quick & easy.

TreeView postback to calling page?

I have page A with form field and a button and when button is clicked it
opens page B in another window. Page B has a treeview control and that is
all. When something is selected I want the page B item to pouplate a form
field on page A. Can this be done and how?
Nov 19 '05 #1
2 1918
Hi Harold
i have an ideas i hope that help
when u fire your events in page B u can put a certain ID in a session say
session("ID")=1 and reload page A
and put condition in page A when session("ID")=1 do want u want
i try this before and it's work
"Harold" wrote:
I have page A with form field and a button and when button is clicked it
opens page B in another window. Page B has a treeview control and that is
all. When something is selected I want the page B item to pouplate a form
field on page A. Can this be done and how?

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" %>;

"sara" <sa**@discussions.microsoft.com> wrote in message
news:B2**********************************@microsof t.com...
Hi Harold
i have an ideas i hope that help
when u fire your events in page B u can put a certain ID in a session say
session("ID")=1 and reload page A
and put condition in page A when session("ID")=1 do want u want
i try this before and it's work
"Harold" wrote:
I have page A with form field and a button and when button is clicked it
opens page B in another window. Page B has a treeview control and that
is
all. When something is selected I want the page B item to pouplate a
form
field on page A. Can this be done and how?

Nov 19 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by xzzy | last post: by
1 post views Thread by kvicky | last post: by
8 posts views Thread by Matt MacDonald | last post: by
1 post views Thread by doemon | last post: by
26 posts views Thread by JJ | last post: by
1 post views Thread by =?Utf-8?B?Rmx5Z3V5?= | last post: by
2 posts views Thread by =?Utf-8?B?QW1pciBUb2hpZGk=?= | last post: by
reply views Thread by theflame83 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.