Doubt passing values

Discussion in 'ASP .Net' started by Paulo Roberto, Aug 11, 2007.

  1. Hi, Im using VS 2005 C# 2.0 and I need to open a new window, using
    JavaScript and pass some values...

    How can I do that not using the get method QueryString
    (file.aspx?name=something)... ???

    Some alternatives ? Is it possible to be done ?

    Thanks !
     
    Paulo Roberto, Aug 11, 2007
    #1
    1. Advertising

  2. Hello,

    You can store it in session (server side):

    http://www.eggheadcafe.com/articles/20021016.asp

    Mmm... another possiblity could be to use Cross Posting, but not sure if
    it will work on a popup, I would use session.

    Some more info about how navigation works on ASP .net:

    http://blogs.msdn.com/tinghaoy/archive/2005/12/22/504357.aspx

    Good Luck
    Braulio


    /// ------------------------------
    /// Braulio Diez
    ///
    /// http://www.tipsdotnet.com
    /// ------------------------------




    "Paulo Roberto" wrote:

    > Hi, Im using VS 2005 C# 2.0 and I need to open a new window, using
    > JavaScript and pass some values...
    >
    > How can I do that not using the get method QueryString
    > (file.aspx?name=something)... ???
    >
    > Some alternatives ? Is it possible to be done ?
    >
    > Thanks !
    >
    >
    >
     
    =?Utf-8?B?QnJhdWxpbyBEaWV6?=, Aug 11, 2007
    #2
    1. Advertising

  3. Paulo Roberto

    Teemu Keiski Guest

    Cross-posting to a popup/new window is possible.
    http://aspadvice.com/blogs/joteke/archive/2006/11/30/Cross_2D00_page-postbacks-and-form-action.aspx

    --
    Teemu Keiski
    AspInsider, ASP.NET MVP
    http://blogs.aspadvice.com/joteke
    http://teemukeiski.net

    "Braulio Diez" <> wrote in message
    news:...
    > Hello,
    >
    > You can store it in session (server side):
    >
    > http://www.eggheadcafe.com/articles/20021016.asp
    >
    > Mmm... another possiblity could be to use Cross Posting, but not sure if
    > it will work on a popup, I would use session.
    >
    > Some more info about how navigation works on ASP .net:
    >
    > http://blogs.msdn.com/tinghaoy/archive/2005/12/22/504357.aspx
    >
    > Good Luck
    > Braulio
    >
    >
    > /// ------------------------------
    > /// Braulio Diez
    > ///
    > /// http://www.tipsdotnet.com
    > /// ------------------------------
    >
    >
    >
    >
    > "Paulo Roberto" wrote:
    >
    >> Hi, Im using VS 2005 C# 2.0 and I need to open a new window, using
    >> JavaScript and pass some values...
    >>
    >> How can I do that not using the get method QueryString
    >> (file.aspx?name=something)... ???
    >>
    >> Some alternatives ? Is it possible to be done ?
    >>
    >> Thanks !
    >>
    >>
    >>
     
    Teemu Keiski, Aug 11, 2007
    #3
  4. Paulo Roberto wrote:
    > Hi, Im using VS 2005 C# 2.0 and I need to open a new window, using
    > JavaScript and pass some values...
    >
    > How can I do that not using the get method QueryString
    > (file.aspx?name=something)... ???
    >
    > Some alternatives ? Is it possible to be done ?
    >
    > Thanks !


    You can open a new window and post a form to it.

    Make a form that posts to a popup:

    <form id="PopupForm" action="file.aspx" target="Popup">
    <input type="hidden" name="some" />
    <input type="hidden" name="more" />
    <input type="hidden" name="other" />
    </form>

    Set the values in the form, open an empty popup, and post the form to it:

    var frm = document.getElementById('PopupForm');
    frm.some.value = '42';
    frm.more.value = 'yeah!';
    frm.other.value = '-1';
    window.open('','Popup');
    frm.submit();

    The values sent to the page can be found in the Request.Form collection.

    --
    Göran Andersson
    _____
    http://www.guffa.com
     
    =?ISO-8859-1?Q?G=F6ran_Andersson?=, Aug 12, 2007
    #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. Bob Nelson

    doubt about doubt

    Bob Nelson, Jul 28, 2006, in forum: C Programming
    Replies:
    11
    Views:
    629
  2. johnnash

    doubt about passing values by address

    johnnash, Feb 19, 2008, in forum: C Programming
    Replies:
    8
    Views:
    352
  3. Replies:
    0
    Views:
    566
  4. Peter Otten
    Replies:
    2
    Views:
    119
    Cousin Stanley
    Aug 10, 2013
  5. Terry Reedy
    Replies:
    0
    Views:
    120
    Terry Reedy
    Aug 10, 2013
Loading...

Share This Page