How to trigger a postback from javascript

Discussion in 'ASP .Net' started by NWx, Feb 16, 2004.

  1. NWx

    NWx Guest

    Hi,

    How can I make a page to postback automatically, using JavaScript?
    I need a JavaScript function as handled to page_load, but I don't know what
    code to write to trigger postback.

    Can anyone help me?
    Regards
     
    NWx, Feb 16, 2004
    #1
    1. Advertising

  2. NWx

    Curt_C [MVP] Guest

    formName.submit()

    --
    Curt Christianson
    Owner/Lead Developer, DF-Software
    www.Darkfalz.com


    "NWx" <> wrote in message
    news:...
    > Hi,
    >
    > How can I make a page to postback automatically, using JavaScript?
    > I need a JavaScript function as handled to page_load, but I don't know

    what
    > code to write to trigger postback.
    >
    > Can anyone help me?
    > Regards
    >
    >
     
    Curt_C [MVP], Feb 16, 2004
    #2
    1. Advertising

  3. "NWx" <> wrote in news::
    > How can I make a page to postback automatically, using JavaScript?


    The form has a submit method that you can call.



    --
    Chad Z. Hower (a.k.a. Kudzu) - http://www.hower.org/Kudzu/
    "Programming is an art form that fights back"


    ELKNews - Get your free copy at http://www.atozedsoftware.com
     
    Chad Z. Hower aka Kudzu, Feb 16, 2004
    #3
  4. NWx

    John Oakes Guest

    Call the __doPostBack function that ASP.NET creates:
    __doPostBack(id,'');

    If you want to see an example of this check out the Time Tracker starter
    kit on www.asp.net. They do this to force a postback after selecting a date
    from a popup calendar.

    -John

    "NWx" <> wrote in message
    news:...
    > Hi,
    >
    > How can I make a page to postback automatically, using JavaScript?
    > I need a JavaScript function as handled to page_load, but I don't know

    what
    > code to write to trigger postback.
    >
    > Can anyone help me?
    > Regards
    >
    >
     
    John Oakes, Feb 16, 2004
    #4
  5. NWx

    Teemu Keiski Guest

    Hi,

    if you want to cause the postback as if happening in behalf of another
    control (means this controls postback event is raised as well), you can use
    Page.GetPostBackEventReference to return the __doPostBack call (it returns
    it as string and you need to place that on page to be called)

    --
    Teemu Keiski
    MCP, Microsoft MVP (ASP.NET), AspInsiders member
    ASP.NET Forum Moderator, AspAlliance Columnist

    "NWx" <> wrote in message
    news:...
    Hi,

    How can I make a page to postback automatically, using JavaScript?
    I need a JavaScript function as handled to page_load, but I don't know what
    code to write to trigger postback.

    Can anyone help me?
    Regards
     
    Teemu Keiski, Feb 16, 2004
    #5
    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. darrel
    Replies:
    3
    Views:
    692
    Scott Allen
    Aug 11, 2004
  2. Terence McGhee

    Manually trigger postback in asp.net

    Terence McGhee, Aug 19, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    558
    =?Utf-8?B?Y2hyaXNjb2xsaW5zb24=?=
    Aug 19, 2004
  3. Terence McGhee

    Manually trigger postback in asp.net

    Terence McGhee, Aug 19, 2004, in forum: ASP .Net
    Replies:
    2
    Views:
    8,619
    =?Utf-8?B?Y2hyaXNjb2xsaW5zb24=?=
    Aug 19, 2004
  4. Steve C. Orr [MVP, MCSD]

    Re: Trigger a Postback

    Steve C. Orr [MVP, MCSD], Aug 27, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    624
    =?Utf-8?B?TWlrZSBEb25uZWxseQ==?=
    Aug 29, 2004
  5. Shiva
    Replies:
    0
    Views:
    631
    Shiva
    Aug 28, 2004
Loading...

Share This Page