RE: TreeView postback to calling page?

Discussion in 'ASP .Net' started by =?Utf-8?B?c2FyYQ==?=, Dec 13, 2004.

  1. 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?
    >
    >
    >
     
    =?Utf-8?B?c2FyYQ==?=, Dec 13, 2004
    #1
    1. Advertising

  2. =?Utf-8?B?c2FyYQ==?=

    Harold Guest

    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" <> wrote in message
    news:...
    > 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?
    >>
    >>
    >>
     
    Harold, Dec 13, 2004
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?VHltYm93?=
    Replies:
    2
    Views:
    24,636
    =?Utf-8?B?VHltYm93?=
    Jan 10, 2006
  2. abargaddon
    Replies:
    0
    Views:
    1,101
    abargaddon
    Jan 17, 2008
  3. Per Salmi

    TreeView not rendering nodes? Cacheing of a TreeView

    Per Salmi, Oct 15, 2003, in forum: ASP .Net Web Controls
    Replies:
    1
    Views:
    515
    Steve Drake
    Oct 15, 2003
  4. Ionutz
    Replies:
    2
    Views:
    568
    Ionutz
    Oct 23, 2005
  5. stepkurt

    Microsoft Treeview vs System Treeview

    stepkurt, Aug 29, 2007, in forum: ASP .Net Web Controls
    Replies:
    1
    Views:
    417
    Teemu Keiski
    Sep 2, 2007
Loading...

Share This Page