Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ASP.NET : What exactly is affected when Javascript is off?

I've heard different stories about ASP.NET and JavaScript: that it works fine with Javascript turned off, that only some parts don't work, and that nothing works at all.

How exactly are ASP.NET applications affected if JavaScript is turned off in a client's browser? What parts don't work (if any)?

For example, will RequiredFieldValidators still work? What about UploadControls? AJAX UpdatePanels and AsyncPostBack's? FileUploads? Do page codebehinds still run?

Forgive my ignorance, I can't seem to find much about the issue that is in-depth.

like image 884
rlb.usa Avatar asked Jun 02 '10 22:06

rlb.usa


People also ask

Does Dot Net use JavaScript?

DotNet. Provides JavaScript interoperability layer in C# and packs project output into single-file JavaScript library via MSBuild task.

What is ASP in JavaScript?

ASP stands for Active Server Pages.

Is ASP.NET JavaScript?

What is ASP.NET? ASP.NET is an open-source framework developed by Microsoft and used for server-side scripting. It uses C# for coding, and developers choose it for new generation websites and web applications using HTML, CSS, and JavaScript.


2 Answers

Client-side validation and Ajax won't work, including async postbacks and any control that requires Javascript in order to work.

Server-side validation (which should always happen anyway) and full postbacks and such should always work, and i think a FileUpload control will as well. The biggest difference would be that someone wouldn't see that the data they entered happened to be invalid til the form was submitted.

like image 119
cHao Avatar answered Sep 23 '22 17:09

cHao


LinkButtons don't work because they render out a javascript: target.

If you use GridView controls with ButtonColumns then these won't work as the buttons are javascript too. One way around this is to use a TemplateColumn and add <asp:Button> objects inside it.

Also GridView paging and sorting is JavaScript out-the-box so you'd have to write custom paging and sorting.

Also any control with AutoPostback set to true (e.g. a DropdownList) will not auto-postback. You will be able to catch the SelectedIndexChanged but ONLY when the next postback happens.

like image 42
bgs264 Avatar answered Sep 22 '22 17:09

bgs264