server.transfer to reload PARENT page (contains frames) -- how to retain values?

Discussion in 'ASP .Net' started by KathyB, Jun 30, 2003.

  1. KathyB

    KathyB Guest

    Hi,

    Been reading a LOT about frames, variables, etc. I realize you can NOT
    use server.transfer with target frames (which are client)...

    I have a Parent frame containing Left and Right frames. IS IT POSSIBLE
    (and HOW please) to do the following:

    4 text controls filled in by user in Left frame, with a button click
    event to:

    Reload Parent frame containing: reload Left frame keeping (or
    replacing) its .text values and load a new Right frame, loading an
    xmlDocument (source filename is needed from a text value in Left
    frame).

    Any EXAMPLES very appreciated...or can I simply NOT do this?

    Thanks, Kathy

    p.s. I know there is a lot of opinion AGAINST frames, but that is not
    an option for me just now...thanks.
    KathyB, Jun 30, 2003
    #1
    1. Advertising

  2. KathyB

    Axel Dahmen Guest

    You might want to use dynamically created client script in your left frame to reload the whole window after postback. You can build a query string on postback to forward to the other frames.

    HTH,
    Axel Dahmen

    ------------------------
    "KathyB" <> schrieb im Newsbeitrag news:...
    > Hi,
    >
    > Been reading a LOT about frames, variables, etc. I realize you can NOT
    > use server.transfer with target frames (which are client)...
    >
    > I have a Parent frame containing Left and Right frames. IS IT POSSIBLE
    > (and HOW please) to do the following:
    >
    > 4 text controls filled in by user in Left frame, with a button click
    > event to:
    >
    > Reload Parent frame containing: reload Left frame keeping (or
    > replacing) its .text values and load a new Right frame, loading an
    > xmlDocument (source filename is needed from a text value in Left
    > frame).
    >
    > Any EXAMPLES very appreciated...or can I simply NOT do this?
    >
    > Thanks, Kathy
    >
    > p.s. I know there is a lot of opinion AGAINST frames, but that is not
    > an option for me just now...thanks.
    Axel Dahmen, Jun 30, 2003
    #2
    1. Advertising

  3. KathyB

    Kathy Burke Guest

    Thanks Axel,

    Could you possibly give me a brief example...?

    KathyBurke

    *** Sent via Developersdex http://www.developersdex.com ***
    Don't just participate in USENET...get rewarded for it!
    Kathy Burke, Jun 30, 2003
    #3
  4. KathyB

    Axel Dahmen Guest

    There are many ways to do that. One would be to add the "onload" event to the left frame's body tag:

    HtmlGenericControl bodyCtrl;

    void Page_Load()
    {
    ...

    if (IsPostBack)
    {
    ...

    string query="";

    query+="var1="+HttpUtility.URLEncode(myTxtBox1.Text);
    query+="&var2="+HttpUtility.URLEncode(myTxtBox2.Text);
    query+="&var3="+HttpUtility.URLEncode(myTxtBox3.Text);
    query+="&var4="+HttpUtility.URLEncode(myTxtBox4.Text);

    bodyCtrl.Attributes.Add("onload","top.location='OuterFrame.aspx?"+query+"'")
    }

    ...
    }

    The body element of your left frame must of course have a RunAt="Server" attribute:

    <body Runat="Server" id="bodyCtrl">


    In your outer frame file then, you forward the query string to the right frame... I guess you know how to create hyperlinks (or any text) dynamically?

    HTH,
    Axel Dahmen

    -------------------------
    "Kathy Burke" <> schrieb im Newsbeitrag news:#...
    > Thanks Axel,
    >
    > Could you possibly give me a brief example...?
    >
    > KathyBurke
    >
    > *** Sent via Developersdex http://www.developersdex.com ***
    > Don't just participate in USENET...get rewarded for it!
    Axel Dahmen, Jul 1, 2003
    #4
    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. Jim
    Replies:
    1
    Views:
    878
    Aaron Bertrand - MVP
    Jan 28, 2004
  2. Replies:
    1
    Views:
    90
    LÅ‘rinczy Zsigmond
    Dec 9, 2004
  3. PWalker
    Replies:
    1
    Views:
    135
    David Lionetti
    Feb 24, 2005
  4. sungung
    Replies:
    3
    Views:
    140
  5. John O. Kopf

    I'm constrained to retain frames...

    John O. Kopf, Oct 28, 2009, in forum: Javascript
    Replies:
    3
    Views:
    78
    Thomas 'PointedEars' Lahn
    Oct 28, 2009
Loading...

Share This Page