Question on Ajax vs. plain javascript

Discussion in 'ASP .Net' started by Bill Gower, Jul 30, 2007.

  1. Bill Gower

    Bill Gower Guest

    I have a asp.net form where if the user checks a check box I need to disable
    some of the fields. I don't need to make a trip to the server for anything
    at this point so is this is a case of using javascript to disable the fields
    or should I be using Ajax do that? As probably can be seen from my post I
    have never used Ajax yet.

    Bill
    Bill Gower, Jul 30, 2007
    #1
    1. Advertising

  2. Bill,

    You may consider Ajax only if you need to immediately react to the checks.
    Since you don't, all you need to do is to make sure that the checkbox's
    AutoPostBack property is not set to true and your server-side app will pick
    up the values on the next postback.

    --
    Eliyahu Goldin,
    Software Developer
    Microsoft MVP [ASP.NET]
    http://msmvps.com/blogs/egoldin
    http://usableasp.net


    "Bill Gower" <> wrote in message
    news:...
    >I have a asp.net form where if the user checks a check box I need to
    >disable some of the fields. I don't need to make a trip to the server for
    >anything at this point so is this is a case of using javascript to disable
    >the fields or should I be using Ajax do that? As probably can be seen from
    >my post I have never used Ajax yet.
    >
    > Bill
    >
    >
    Eliyahu Goldin, Jul 30, 2007
    #2
    1. Advertising

  3. Bill Gower

    Bill Gower Guest

    So you are saying to just use Javascript to disable the controls that need
    to be?

    Bill

    "Eliyahu Goldin" <> wrote in
    message news:%...
    > Bill,
    >
    > You may consider Ajax only if you need to immediately react to the checks.
    > Since you don't, all you need to do is to make sure that the checkbox's
    > AutoPostBack property is not set to true and your server-side app will
    > pick up the values on the next postback.
    >
    > --
    > Eliyahu Goldin,
    > Software Developer
    > Microsoft MVP [ASP.NET]
    > http://msmvps.com/blogs/egoldin
    > http://usableasp.net
    >
    >
    > "Bill Gower" <> wrote in message
    > news:...
    >>I have a asp.net form where if the user checks a check box I need to
    >>disable some of the fields. I don't need to make a trip to the server for
    >>anything at this point so is this is a case of using javascript to disable
    >>the fields or should I be using Ajax do that? As probably can be seen
    >>from my post I have never used Ajax yet.
    >>
    >> Bill
    >>
    >>

    >
    >
    Bill Gower, Jul 30, 2007
    #3
  4. What do you want to disable the controls for?

    --
    Eliyahu Goldin,
    Software Developer
    Microsoft MVP [ASP.NET]
    http://msmvps.com/blogs/egoldin
    http://usableasp.net


    "Bill Gower" <> wrote in message
    news:...
    > So you are saying to just use Javascript to disable the controls that need
    > to be?
    >
    > Bill
    >
    > "Eliyahu Goldin" <> wrote in
    > message news:%...
    >> Bill,
    >>
    >> You may consider Ajax only if you need to immediately react to the
    >> checks. Since you don't, all you need to do is to make sure that the
    >> checkbox's AutoPostBack property is not set to true and your server-side
    >> app will pick up the values on the next postback.
    >>
    >> --
    >> Eliyahu Goldin,
    >> Software Developer
    >> Microsoft MVP [ASP.NET]
    >> http://msmvps.com/blogs/egoldin
    >> http://usableasp.net
    >>
    >>
    >> "Bill Gower" <> wrote in message
    >> news:...
    >>>I have a asp.net form where if the user checks a check box I need to
    >>>disable some of the fields. I don't need to make a trip to the server
    >>>for anything at this point so is this is a case of using javascript to
    >>>disable the fields or should I be using Ajax do that? As probably can be
    >>>seen from my post I have never used Ajax yet.
    >>>
    >>> Bill
    >>>
    >>>

    >>
    >>

    >
    >
    Eliyahu Goldin, Jul 30, 2007
    #4
  5. Bill Gower

    chenhong Guest

    as you mentioned you dont need to make a trip to the server to disable some
    fields.so dont.
    here partial update will make no sense.

    "Bill Gower" <> дÈëÏûÏ¢ÐÂÎÅ:...
    >I have a asp.net form where if the user checks a check box I need to
    >disable some of the fields. I don't need to make a trip to the server for
    >anything at this point so is this is a case of using javascript to disable
    >the fields or should I be using Ajax do that? As probably can be seen from
    >my post I have never used Ajax yet.
    >
    > Bill
    >
    >
    chenhong, Jul 30, 2007
    #5
  6. Bill Gower

    Bill Gower Guest

    Because they are not applicable if the checkbox is checked.

    Bill

    "Eliyahu Goldin" <> wrote in
    message news:...
    > What do you want to disable the controls for?
    >
    > --
    > Eliyahu Goldin,
    > Software Developer
    > Microsoft MVP [ASP.NET]
    > http://msmvps.com/blogs/egoldin
    > http://usableasp.net
    >
    >
    > "Bill Gower" <> wrote in message
    > news:...
    >> So you are saying to just use Javascript to disable the controls that
    >> need to be?
    >>
    >> Bill
    >>
    >> "Eliyahu Goldin" <> wrote in
    >> message news:%...
    >>> Bill,
    >>>
    >>> You may consider Ajax only if you need to immediately react to the
    >>> checks. Since you don't, all you need to do is to make sure that the
    >>> checkbox's AutoPostBack property is not set to true and your server-side
    >>> app will pick up the values on the next postback.
    >>>
    >>> --
    >>> Eliyahu Goldin,
    >>> Software Developer
    >>> Microsoft MVP [ASP.NET]
    >>> http://msmvps.com/blogs/egoldin
    >>> http://usableasp.net
    >>>
    >>>
    >>> "Bill Gower" <> wrote in message
    >>> news:...
    >>>>I have a asp.net form where if the user checks a check box I need to
    >>>>disable some of the fields. I don't need to make a trip to the server
    >>>>for anything at this point so is this is a case of using javascript to
    >>>>disable the fields or should I be using Ajax do that? As probably can
    >>>>be seen from my post I have never used Ajax yet.
    >>>>
    >>>> Bill
    >>>>
    >>>>
    >>>
    >>>

    >>
    >>

    >
    >
    Bill Gower, Jul 30, 2007
    #6
  7. Then yes, your best option is client-side disabling with javascript.

    --
    Eliyahu Goldin,
    Software Developer
    Microsoft MVP [ASP.NET]
    http://msmvps.com/blogs/egoldin
    http://usableasp.net


    "Bill Gower" <> wrote in message
    news:%...
    > Because they are not applicable if the checkbox is checked.
    >
    > Bill
    >
    > "Eliyahu Goldin" <> wrote in
    > message news:...
    >> What do you want to disable the controls for?
    >>
    >> --
    >> Eliyahu Goldin,
    >> Software Developer
    >> Microsoft MVP [ASP.NET]
    >> http://msmvps.com/blogs/egoldin
    >> http://usableasp.net
    >>
    >>
    >> "Bill Gower" <> wrote in message
    >> news:...
    >>> So you are saying to just use Javascript to disable the controls that
    >>> need to be?
    >>>
    >>> Bill
    >>>
    >>> "Eliyahu Goldin" <> wrote in
    >>> message news:%...
    >>>> Bill,
    >>>>
    >>>> You may consider Ajax only if you need to immediately react to the
    >>>> checks. Since you don't, all you need to do is to make sure that the
    >>>> checkbox's AutoPostBack property is not set to true and your
    >>>> server-side app will pick up the values on the next postback.
    >>>>
    >>>> --
    >>>> Eliyahu Goldin,
    >>>> Software Developer
    >>>> Microsoft MVP [ASP.NET]
    >>>> http://msmvps.com/blogs/egoldin
    >>>> http://usableasp.net
    >>>>
    >>>>
    >>>> "Bill Gower" <> wrote in message
    >>>> news:...
    >>>>>I have a asp.net form where if the user checks a check box I need to
    >>>>>disable some of the fields. I don't need to make a trip to the server
    >>>>>for anything at this point so is this is a case of using javascript to
    >>>>>disable the fields or should I be using Ajax do that? As probably can
    >>>>>be seen from my post I have never used Ajax yet.
    >>>>>
    >>>>> Bill
    >>>>>
    >>>>>
    >>>>
    >>>>
    >>>
    >>>

    >>
    >>

    >
    >
    Eliyahu Goldin, Jul 30, 2007
    #7
  8. I'd suggest using JavaScript in this case.
    No need for AJAX here.

    --
    I hope this helps,
    Steve C. Orr,
    MCSD, MVP, CSM, ASPInsider
    http://SteveOrr.net


    "Bill Gower" <> wrote in message
    news:...
    >I have a asp.net form where if the user checks a check box I need to
    >disable some of the fields. I don't need to make a trip to the server for
    >anything at this point so is this is a case of using javascript to disable
    >the fields or should I be using Ajax do that? As probably can be seen from
    >my post I have never used Ajax yet.
    >
    > Bill
    >
    >
    Steve C. Orr [MCSD, MVP, CSM, ASP Insider], Jul 30, 2007
    #8
    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. DamonChong
    Replies:
    11
    Views:
    568
    msalters
    Jan 31, 2005
  2. minnie
    Replies:
    1
    Views:
    682
    Andrew Thompson
    Dec 13, 2006
  3. Nathan Sokalski
    Replies:
    2
    Views:
    472
    Nathan Sokalski
    Jun 2, 2007
  4. hoke
    Replies:
    4
    Views:
    472
    Roland Hall
    Jan 29, 2004
  5. Jake Barnes
    Replies:
    3
    Views:
    153
    Jake Barnes
    Sep 10, 2007
Loading...

Share This Page