Passing multiple arguments to the client-side JavaScript function in AJAX

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Nathan Sokalski

    Passing multiple arguments to the client-side JavaScript function in AJAX

    I am a beginner with AJAX, and have managed to learn how to use it when
    passing single parameters, but I want to return more than one value to the
    client-side JavaScript function that displays it. My client-side JavaScript
    function takes 4 parameters (which are expected to be integers). The idea of
    passing a single parameter and parsing it on the client has occurred to me,
    but since I am sure I am not the only person who has situations that require
    more than one parameter, I was hoping there would be an easier way. Any
    ideas? Thanks.
    --
    Nathan Sokalski
    njsokalski@hotm ail.com
    有声小说网为广大读者提供热门小说在线免费阅读,本站收集的网络文学小说情节跌宕起伏,有声小说网是值得书友们收藏的小说在线阅读网。



  • Laurent Bugnion

    #2
    Re: Passing multiple arguments to the client-side JavaScript functionin AJAX

    Hi,

    Nathan Sokalski wrote:
    I am a beginner with AJAX, and have managed to learn how to use it when
    passing single parameters, but I want to return more than one value to the
    client-side JavaScript function that displays it. My client-side JavaScript
    function takes 4 parameters (which are expected to be integers). The idea of
    passing a single parameter and parsing it on the client has occurred to me,
    but since I am sure I am not the only person who has situations that require
    more than one parameter, I was hoping there would be an easier way. Any
    ideas? Thanks.
    AJAX doesn't mean much. Do you use SOAP, or a simple ASHX custom
    handler, or something else?

    With SOAP, you can pass an object back to the JavaScript client. Note
    that unless you use a library doing that for you (for example ASP.NET
    AJAX formerly known as ATLAS), you must parse the result yourself.

    If you use a custom handler, you can return XML in the response, and
    then parse the received XML. Nothing prevents you then to define your
    own XML format to pass any number of parameters to the script.

    HTH,
    Laurent
    --
    Laurent Bugnion, GalaSoft
    Software engineering: http://www.galasoft-LB.ch
    PhotoAlbum: http://www.galasoft-LB.ch/pictures
    Support children in Calcutta: http://www.calcutta-espoir.ch

    Comment

    • Nathan Sokalski

      #3
      Re: Passing multiple arguments to the client-side JavaScript function in AJAX

      Sorry, I probably should have included more details. I am writing a custom
      control for ASP.NET using VB.NET and want to include AJAX. I am using the
      following for the AJAX:

      I am using the ICallbackEventH andler interface by including the following
      line:
      Implements ICallbackEventH andler

      This interface includes implementing the following method and function:
      Public Sub RaiseCallbackEv ent(ByVal eventArgument As String) Implements
      ICallbackEventH andler.RaiseCal lbackEvent
      Public Function GetCallbackResu lt() As String Implements
      ICallbackEventH andler.GetCallb ackResult


      Because ATLAS is still in Beta (at least the last time I checked), I did not
      want to start using it yet. If I understand you correct, there is no simple
      way to pass multiple parameters using only VB.NET and JavaScript? Thank you
      for the information.
      --
      Nathan Sokalski
      njsokalski@hotm ail.com
      有声小说网为广大读者提供热门小说在线免费阅读,本站收集的网络文学小说情节跌宕起伏,有声小说网是值得书友们收藏的小说在线阅读网。


      "Laurent Bugnion" <galasoft-lb@bluewin.chwr ote in message
      news:%23RhOuAHD HHA.4404@TK2MSF TNGP03.phx.gbl. ..
      Hi,
      >
      Nathan Sokalski wrote:
      >I am a beginner with AJAX, and have managed to learn how to use it when
      >passing single parameters, but I want to return more than one value to
      >the client-side JavaScript function that displays it. My client-side
      >JavaScript function takes 4 parameters (which are expected to be
      >integers). The idea of passing a single parameter and parsing it on the
      >client has occurred to me, but since I am sure I am not the only person
      >who has situations that require more than one parameter, I was hoping
      >there would be an easier way. Any ideas? Thanks.
      >
      AJAX doesn't mean much. Do you use SOAP, or a simple ASHX custom handler,
      or something else?
      >
      With SOAP, you can pass an object back to the JavaScript client. Note that
      unless you use a library doing that for you (for example ASP.NET AJAX
      formerly known as ATLAS), you must parse the result yourself.
      >
      If you use a custom handler, you can return XML in the response, and then
      parse the received XML. Nothing prevents you then to define your own XML
      format to pass any number of parameters to the script.
      >
      HTH,
      Laurent
      --
      Laurent Bugnion, GalaSoft
      Software engineering: http://www.galasoft-LB.ch
      PhotoAlbum: http://www.galasoft-LB.ch/pictures
      Support children in Calcutta: http://www.calcutta-espoir.ch

      Comment

      • Michael Schwarz

        #4
        Re: Passing multiple arguments to the client-side JavaScript function in AJAX

        Hi,

        with Ajax.NET Professional (http://www.ajaxpro.info/) you can use multiple
        parameters to call .NET methods. As return value you can use any type, i.e.
        DataTable or arrays or your own structures/classes.

        --
        Best regards | Schöne Grüße
        Michael

        Microsoft MVP - Most Valuable Professional
        Microsoft MCAD - Certified Application Developer







        "Nathan Sokalski" <njsokalski@hot mail.comschrieb im Newsbeitrag
        news:OjQ6ijLDHH A.3492@TK2MSFTN GP02.phx.gbl...
        Sorry, I probably should have included more details. I am writing a custom
        control for ASP.NET using VB.NET and want to include AJAX. I am using the
        following for the AJAX:
        >
        I am using the ICallbackEventH andler interface by including the following
        line:
        Implements ICallbackEventH andler
        >
        This interface includes implementing the following method and function:
        Public Sub RaiseCallbackEv ent(ByVal eventArgument As String) Implements
        ICallbackEventH andler.RaiseCal lbackEvent
        Public Function GetCallbackResu lt() As String Implements
        ICallbackEventH andler.GetCallb ackResult
        >
        >
        Because ATLAS is still in Beta (at least the last time I checked), I did
        not want to start using it yet. If I understand you correct, there is no
        simple way to pass multiple parameters using only VB.NET and JavaScript?
        Thank you for the information.
        --
        Nathan Sokalski
        njsokalski@hotm ail.com
        有声小说网为广大读者提供热门小说在线免费阅读,本站收集的网络文学小说情节跌宕起伏,有声小说网是值得书友们收藏的小说在线阅读网。

        >
        "Laurent Bugnion" <galasoft-lb@bluewin.chwr ote in message
        news:%23RhOuAHD HHA.4404@TK2MSF TNGP03.phx.gbl. ..
        >Hi,
        >>
        >Nathan Sokalski wrote:
        >>I am a beginner with AJAX, and have managed to learn how to use it when
        >>passing single parameters, but I want to return more than one value to
        >>the client-side JavaScript function that displays it. My client-side
        >>JavaScript function takes 4 parameters (which are expected to be
        >>integers). The idea of passing a single parameter and parsing it on the
        >>client has occurred to me, but since I am sure I am not the only person
        >>who has situations that require more than one parameter, I was hoping
        >>there would be an easier way. Any ideas? Thanks.
        >>
        >AJAX doesn't mean much. Do you use SOAP, or a simple ASHX custom handler,
        >or something else?
        >>
        >With SOAP, you can pass an object back to the JavaScript client. Note
        >that unless you use a library doing that for you (for example ASP.NET
        >AJAX formerly known as ATLAS), you must parse the result yourself.
        >>
        >If you use a custom handler, you can return XML in the response, and then
        >parse the received XML. Nothing prevents you then to define your own XML
        >format to pass any number of parameters to the script.
        >>
        >HTH,
        >Laurent
        >--
        >Laurent Bugnion, GalaSoft
        >Software engineering: http://www.galasoft-LB.ch
        >PhotoAlbum: http://www.galasoft-LB.ch/pictures
        >Support children in Calcutta: http://www.calcutta-espoir.ch
        >
        >

        Comment

        • Steve C. Orr [MVP, MCSD]

          #5
          Re: Passing multiple arguments to the client-side JavaScript function in AJAX

          I've done what you are describing in my WebChat control.
          The included source code and article should provice all you need:
          HALOJP adalah situs slot online resmi terpercaya yang tawarkan akses gampang maxwin. Cukup depo 10k, nikmati ribuan game gacor dengan sistem aman dan pembayaran lancar.


          --
          I hope this helps,
          Steve C. Orr,
          MCSD, MVP, CSM, ASPInsider
          HALOJP adalah situs slot online resmi terpercaya yang tawarkan akses gampang maxwin. Cukup depo 10k, nikmati ribuan game gacor dengan sistem aman dan pembayaran lancar.



          "Nathan Sokalski" <njsokalski@hot mail.comwrote in message
          news:eK3CIYFDHH A.4144@TK2MSFTN GP06.phx.gbl...
          >I am a beginner with AJAX, and have managed to learn how to use it when
          >passing single parameters, but I want to return more than one value to the
          >client-side JavaScript function that displays it. My client-side JavaScript
          >function takes 4 parameters (which are expected to be integers). The idea
          >of passing a single parameter and parsing it on the client has occurred to
          >me, but since I am sure I am not the only person who has situations that
          >require more than one parameter, I was hoping there would be an easier way.
          >Any ideas? Thanks.
          --
          Nathan Sokalski
          njsokalski@hotm ail.com
          有声小说网为广大读者提供热门小说在线免费阅读,本站收集的网络文学小说情节跌宕起伏,有声小说网是值得书友们收藏的小说在线阅读网。

          >

          Comment

          Working...