Pass a parameter from one page to the other page with iFrame tag

Discussion in 'ASP .Net' started by =?Utf-8?B?YmJzYm9i?=, Nov 24, 2006.

  1. Hello,

    I'm still using the Framework v1.1. Forgive me, I'm working on a legacy
    application.
    I'm using 2 iFrame sections with 2 aspx pages, i.e. 1.aspx (left) and 2.aspx
    (right)
    In 1.appx page, I have a treeview control, I'd like to pass a selected node
    string to 2.aspx page and then to display some contents with passed node
    string.
    How could I accomplish that? The task is to pass the string parameter and
    then invoke the 2.aspx page to refresh the display.

    I'd appreciate for getting any help.
    --
    Doing software as simple as possible
    =?Utf-8?B?YmJzYm9i?=, Nov 24, 2006
    #1
    1. Advertising

  2. If you've got two separate .aspx pages each loaded into an IFRAME, and you
    need for the second page to get a querystring parameter when something
    happens in the first, then you have to make the second IFRAME reload it's
    page, with the querystring appended at the end so your code in your second
    page's Page_Load handler can check for it and react. Right?
    So, you could either try making the second IFRAME runat=server and reset
    it's src property, or you could do it with client script with something *like*

    document.Frames[1].src="xxxx?id=yyyy";

    Peter

    --
    Co-founder, Eggheadcafe.com developer portal:
    http://www.eggheadcafe.com
    UnBlog:
    http://petesbloggerama.blogspot.com




    "bbsbob" wrote:

    > Hello,
    >
    > I'm still using the Framework v1.1. Forgive me, I'm working on a legacy
    > application.
    > I'm using 2 iFrame sections with 2 aspx pages, i.e. 1.aspx (left) and 2.aspx
    > (right)
    > In 1.appx page, I have a treeview control, I'd like to pass a selected node
    > string to 2.aspx page and then to display some contents with passed node
    > string.
    > How could I accomplish that? The task is to pass the string parameter and
    > then invoke the 2.aspx page to refresh the display.
    >
    > I'd appreciate for getting any help.
    > --
    > Doing software as simple as possible
    =?Utf-8?B?UGV0ZXIgQnJvbWJlcmcgW0MjIE1WUF0=?=, Nov 24, 2006
    #2
    1. Advertising

  3. RE: Pass a parameter from one page to the other page with iFrame t

    Hi, Peter,

    Very appreciate for your reply!

    I'd prefer using the code behind pattern. Could you please show me the
    syntax in C#? The following is my code example:

    From 1.aspx, user selected a node from a treeview control:

    private void OrganTree_SelectedIndexChange(object sender,
    Microsoft.Web.UI.WebControls.TreeViewSelectEventArgs e)
    {
    string NodeCode = e.NewNode.ToString();
    }

    From 2.aspx, I'd expect to get the selected tree node string.

    private void Page_Load(object sender, System.EventArgs e)
    {
    // Put user code to initialize the page here
    if( !IsPostBack )
    {
    }
    }

    My question is how to trigger 2.aspx to react from 1.aspx after a user action?

    Thank you so much!
    bbsbob
    --
    Doing software as simple as possible


    "Peter Bromberg [C# MVP]" wrote:

    > If you've got two separate .aspx pages each loaded into an IFRAME, and you
    > need for the second page to get a querystring parameter when something
    > happens in the first, then you have to make the second IFRAME reload it's
    > page, with the querystring appended at the end so your code in your second
    > page's Page_Load handler can check for it and react. Right?
    > So, you could either try making the second IFRAME runat=server and reset
    > it's src property, or you could do it with client script with something *like*
    >
    > document.Frames[1].src="xxxx?id=yyyy";
    >
    > Peter
    >
    > --
    > Co-founder, Eggheadcafe.com developer portal:
    > http://www.eggheadcafe.com
    > UnBlog:
    > http://petesbloggerama.blogspot.com
    >
    >
    >
    >
    > "bbsbob" wrote:
    >
    > > Hello,
    > >
    > > I'm still using the Framework v1.1. Forgive me, I'm working on a legacy
    > > application.
    > > I'm using 2 iFrame sections with 2 aspx pages, i.e. 1.aspx (left) and 2.aspx
    > > (right)
    > > In 1.appx page, I have a treeview control, I'd like to pass a selected node
    > > string to 2.aspx page and then to display some contents with passed node
    > > string.
    > > How could I accomplish that? The task is to pass the string parameter and
    > > then invoke the 2.aspx page to refresh the display.
    > >
    > > I'd appreciate for getting any help.
    > > --
    > > Doing software as simple as possible
    =?Utf-8?B?YmJzYm9i?=, Nov 24, 2006
    #3
    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. shruds
    Replies:
    1
    Views:
    709
    John C. Bollinger
    Jan 27, 2006
  2. elca
    Replies:
    0
    Views:
    553
  3. Daedalous
    Replies:
    3
    Views:
    653
    Daedalous
    Jan 16, 2004
  4. Replies:
    3
    Views:
    81
  5. AzamSharp
    Replies:
    2
    Views:
    151
Loading...

Share This Page