Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / July 2007

Tip: Looking for answers? Try searching our database.

Question on Ajax vs. plain javascript

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Bill Gower - 30 Jul 2007 15:01 GMT
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 - 30 Jul 2007 15:07 GMT
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.

Signature

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

>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
[quoted text clipped - 3 lines]
>
> Bill
Bill Gower - 30 Jul 2007 15:20 GMT
So you are saying to just use Javascript to disable the controls that need
to be?

Bill

> Bill,
>
[quoted text clipped - 10 lines]
>>
>> Bill
Eliyahu Goldin - 30 Jul 2007 15:22 GMT
What do you want to disable the controls for?

Signature

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

> So you are saying to just use Javascript to disable the controls that need
> to be?
[quoted text clipped - 15 lines]
>>>
>>> Bill
Bill Gower - 30 Jul 2007 15:54 GMT
Because they are not applicable if the checkbox is checked.

Bill

> What do you want to disable the controls for?
>
[quoted text clipped - 17 lines]
>>>>
>>>> Bill
Eliyahu Goldin - 30 Jul 2007 16:16 GMT
Then yes, your best option is client-side disabling with javascript.

Signature

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

> Because they are not applicable if the checkbox is checked.
>
[quoted text clipped - 21 lines]
>>>>>
>>>>> Bill
chenhong - 30 Jul 2007 15:52 GMT
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" <billgower@charter.net> дÈëÏûÏ¢ÐÂÎÅ:OIFxOIr0HHA.3916@TK2MSFTNGP02.phx.gbl...
>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
[quoted text clipped - 3 lines]
>
> Bill
Steve C. Orr [MCSD, MVP, CSM, ASP Insider] - 30 Jul 2007 22:15 GMT
I'd suggest using JavaScript in this case.
No need for AJAX here.

Signature

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

>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
[quoted text clipped - 3 lines]
>
> Bill

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.