Ajax or just javascript

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

    Ajax or just javascript

    Hi,

    I wander what to do. I'm developing a webapplication. One of the parts is to
    show records from a database.
    To modifiy a value, text of relational link or date I would like to use Ajax
    where possible. I saw the posiibilty of the Ajax control toolkit with the
    calendar extender.
    How nice. But is it fast? Thats the question, because the roundtrip to the
    server would build the full page in postback and only the changes will be
    posted back to the client. But it still is a full "renew" of the entire
    page.
    So my question is:

    What is the advantage of using these controls, is it really faster, or is
    there another way (javascript) to get a small calendar when the date-field
    got the focus.

    Please comment of better help me if you can

    Thanx in advance


    Ton

  • Mark Rae [MVP]

    #2
    Re: Ajax or just javascript

    "ton" <ton@nospam.nlw rote in message
    news:14ce5$4843 f1f0$541ef063$8 988@cache3.tilb u1.nb.home.nl.. .
    What is the advantage of using these controls, is it really faster, or is
    there another way (javascript) to get a small calendar when the date-field
    got the focus.
    Ajax is superb technology. However, that does not mean that it must be used
    for every eventuality...

    The calendar example is a good one. I have a JavaScript calendar which I've
    used for years. It does everything I require of it, namely to display a
    month at a time and to respond to mouse clicks. While the user is scrolling
    backwards and forwards through the months there is no roundtrip to the
    server at all. When the user chooses a date, I can add the date to a DOM
    control or cause a postback if I want to. I can even persuade it to call a
    server-side C# function via Ajax. The only time I might want it to retrieve
    data from the server is when the client requires more functionality that
    this e.g. they might want to display public holidays in a different font or
    colour or whatever. Then, the calendar control would need server-side
    connectivity, almost certainly through Ajax.

    You are correct that Ajax callbacks are not so "heavy" as full postbacks,
    but they do still involve a roundtrip to the server.

    It's always been my belief that one of the simplest ways to improve a web
    application's performance is to minimise the roundtrips to the server.

    So, I would say that if it can be done client-side with JavaScript, then do
    it client-side with JavaScript. This applies especially to things like
    validation - e.g. there is absolutely no requirement whatever to validate
    the contents of a numeric-only TextBox server-side...

    I'd also advise you to have a serious look at Silverlight - some of the
    possibilities with that technology are bordering on the revolutionary.. .


    --
    Mark Rae
    ASP.NET MVP


    Comment

    • ton

      #3
      Re: Ajax or just javascript

      thank you. It is just what I had in mind. Ajax but not for everything

      can you tell me what calendar control you use? And is it hard to implement
      it on VB.NET websites?
      Or better can it be used in a web server control, because I've allready
      developed a webserver control which displays te record of a table in 2
      columns. To modifiy a date field the user has to type the date and I want to
      chenge this by using a ajax or javascript control.

      thanx

      Ton

      "Mark Rae [MVP]" <mark@markNOSPA Mrae.netschreef in bericht
      news:%23%23PPBV MxIHA.5892@TK2M SFTNGP02.phx.gb l...
      "ton" <ton@nospam.nlw rote in message
      news:14ce5$4843 f1f0$541ef063$8 988@cache3.tilb u1.nb.home.nl.. .
      >
      >What is the advantage of using these controls, is it really faster, or is
      >there another way (javascript) to get a small calendar when the
      >date-field got the focus.
      >
      Ajax is superb technology. However, that does not mean that it must be
      used for every eventuality...
      >
      The calendar example is a good one. I have a JavaScript calendar which
      I've used for years. It does everything I require of it, namely to display
      a month at a time and to respond to mouse clicks. While the user is
      scrolling backwards and forwards through the months there is no roundtrip
      to the server at all. When the user chooses a date, I can add the date to
      a DOM control or cause a postback if I want to. I can even persuade it to
      call a server-side C# function via Ajax. The only time I might want it to
      retrieve data from the server is when the client requires more
      functionality that this e.g. they might want to display public holidays in
      a different font or colour or whatever. Then, the calendar control would
      need server-side connectivity, almost certainly through Ajax.
      >
      You are correct that Ajax callbacks are not so "heavy" as full postbacks,
      but they do still involve a roundtrip to the server.
      >
      It's always been my belief that one of the simplest ways to improve a web
      application's performance is to minimise the roundtrips to the server.
      >
      So, I would say that if it can be done client-side with JavaScript, then
      do it client-side with JavaScript. This applies especially to things like
      validation - e.g. there is absolutely no requirement whatever to validate
      the contents of a numeric-only TextBox server-side...
      >
      I'd also advise you to have a serious look at Silverlight - some of the
      possibilities with that technology are bordering on the revolutionary.. .
      >
      >
      --
      Mark Rae
      ASP.NET MVP
      http://www.markrae.net

      Comment

      • Mark Rae [MVP]

        #4
        Re: Ajax or just javascript

        "ton" <ton@nospam.nlw rote in message
        news:2474c$4844 2fac$541ef063$4 935@cache3.tilb u1.nb.home.nl.. .

        [top-posting corrected]
        >The calendar example is a good one. I have a JavaScript calendar which
        >I've used for years.
        Can you tell me what calendar control you use?
        It's one that I wrote myself based on several that I found on the Internet,
        all of which did part of what I wanted...
        And is it hard to implement it on VB.NET websites?
        I've never tried it with VB.NET as I never use that but, as I said, it's
        pure client-side JavaScript so the server-side language is irrelevant...
        Or better can it be used in a web server control
        As above...


        --
        Mark Rae
        ASP.NET MVP


        Comment

        • ton

          #5
          Re: Ajax or just javascript

          thanx

          ton

          "Mark Rae [MVP]" <mark@markNOSPA Mrae.netschreef in bericht
          news:eRejDvNxIH A.4772@TK2MSFTN GP03.phx.gbl...
          "ton" <ton@nospam.nlw rote in message
          news:2474c$4844 2fac$541ef063$4 935@cache3.tilb u1.nb.home.nl.. .
          >
          [top-posting corrected]
          >
          >>The calendar example is a good one. I have a JavaScript calendar which
          >>I've used for years.
          >
          >Can you tell me what calendar control you use?
          >
          It's one that I wrote myself based on several that I found on the
          Internet, all of which did part of what I wanted...
          >
          >And is it hard to implement it on VB.NET websites?
          >
          I've never tried it with VB.NET as I never use that but, as I said, it's
          pure client-side JavaScript so the server-side language is irrelevant...
          >
          >Or better can it be used in a web server control
          >
          As above...
          >
          >
          --
          Mark Rae
          ASP.NET MVP
          http://www.markrae.net

          Comment

          Working...