Does JavaScript include in the browser MUST work with ASP.NET pages?

This is a newbie question (I'm sure it is). I tried for the first time in a small ASP.NET web application. I am working on what will happen if I turn off Javascript in the browser (I mainly test with Firefox).

Result: my application is completely broken, although I have never written a single line of Javascript.

For example: I have a link button on a page from a LoginStatus control. If you look at the generated HTML in my browser, I see the following:

<a id="ctl00_ctl00_LoginStatus" href="javascript:__doPostBack('ctl00$ctl00$LoginStatus$ctl02','')">Login</a>

As well as some key links in a ListView control that allow you to sort the list according to certain data fields: hrefcreated anchor tag contains the following: javascript:WebForm_DoPostBackWithOptions(...).

Thus, clicking on "Login" or trying to sort does not work without Javascript enabled.

Does this mean: with Javascript disabled in the browser, ASP.NET applications will not work properly? Or what do I need to do to make the application work with Javascript disabled?

Thanks for the feedback!

+5
source share
2 answers

Some things will work, some will not (see here ). This does not mean that you cannot use ASP.NET without Javascript, you just need to avoid the controls described below (and I am sure that there are many third-party controls as well).

ASP.NET controls that depend on the ability to run the client script include:

  • LinkButton HtmlButton script. ( - Button HtmlInputButton HtmlInputImage.)
  • LinkButton. , , , , script. , script.
  • -, AutoPostBack true; script , .
  • -, script . script, .
+5

ASP.NET MVC, , ASP.NET, -, JavaScript.

autopostback , linkbutton button, , .

+4

All Articles