cause postback with javascript function

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • =?Utf-8?B?UGF1bA==?=

    cause postback with javascript function

    Just wondering if there is a way to cause a post back with a javascript
    function?
    Thanks.
    --
    Paul G
    Software engineer.
  • George

    #2
    Re: cause postback with javascript function

    Pretty much that is the only way :)


    Dump any empty (not text propery specified ) LinkButton on the form and
    check out generated HTML.
    You will see somehting like OnClick="__doPo stBack('$LinkBu tton1');"

    that is the way :)

    George.



    "Paul" <Paul@discussio ns.microsoft.co mwrote in message
    news:47CA3788-B545-4A86-8C0F-A3C2C9D0A571@mi crosoft.com...
    Just wondering if there is a way to cause a post back with a javascript
    function?
    Thanks.
    --
    Paul G
    Software engineer.

    Comment

    • Lloyd Sheen

      #3
      Re: cause postback with javascript function


      "Paul" <Paul@discussio ns.microsoft.co mwrote in message
      news:47CA3788-B545-4A86-8C0F-A3C2C9D0A571@mi crosoft.com...
      Just wondering if there is a way to cause a post back with a javascript
      function?
      Thanks.
      --
      Paul G
      Software engineer.
      Check out the __doPostBack javascript function. This is what gets called on
      a regular asp.net postback. You can set the parameters to values.

      Hope this helps
      LS

      Comment

      • Gustavo Cantero

        #4
        Re: cause postback with javascript function

        Paul:
        You can get the script to cause a postback with this method:
        Page.ClientScri pt.GetPostBackE ventReference.
        Other way to do this is adding a button to the page and calling it from
        JS:

        string strJavaScript = button1.ClientI D + ".click();" ;

        Good luck!

        Gustavo A. Cantero
        CEO - Scientia® Soluciones Informáticas
        MCP - MCSD - MCTS

        El blog de Scientia® Soluciones Informáticas



        -----Mensaje original-----
        De: Paul [mailto:Paul@dis cussions.micros oft.com]
        Expuesto a las: Miércoles, 29 de Octubre de 2008 07:30 p.m.
        Expuesto en: microsoft.publi c.dotnet.framew ork.aspnet
        Conversación: cause postback with javascript function
        Asunto: cause postback with javascript function

        Just wondering if there is a way to cause a post back with a javascript
        function?
        Thanks.
        --
        Paul G
        Software engineer.

        Comment

        • =?Utf-8?B?UGF1bA==?=

          #5
          Re: cause postback with javascript function

          thanks for the responses, I need to pass parameters to the URL string on the
          post back so thinking a few of these methods should work.
          --
          Paul G
          Software engineer.


          "Gustavo Cantero" wrote:
          Paul:
          You can get the script to cause a postback with this method:
          Page.ClientScri pt.GetPostBackE ventReference.
          Other way to do this is adding a button to the page and calling it from
          JS:
          >
          string strJavaScript = button1.ClientI D + ".click();" ;
          >
          Good luck!
          >
          Gustavo A. Cantero
          CEO - Scientia® Soluciones Informáticas
          MCP - MCSD - MCTS

          El blog de Scientia® Soluciones Informáticas


          >
          -----Mensaje original-----
          De: Paul [mailto:Paul@dis cussions.micros oft.com]
          Expuesto a las: Miércoles, 29 de Octubre de 2008 07:30 p.m.
          Expuesto en: microsoft.publi c.dotnet.framew ork.aspnet
          Conversación: cause postback with javascript function
          Asunto: cause postback with javascript function
          >
          Just wondering if there is a way to cause a post back with a javascript
          function?
          Thanks.
          --
          Paul G
          Software engineer.
          >
          >

          Comment

          Working...