Just a quick question. If a page does postbacks or ajax methods using javascript, and a users pc has javascript disabled, then what are the consequences?
Lets say I make a project that has only one page. The page has a dropdownlist with the states and has autopostback = true;
Once the user chooses the state, it does a postback, and the server side code will excecute with Response.Write("You are from New York...");
In the same scenario, what would happen if the users pc had js disabled?
If you disable JavaScript, the functionality that relies on it won't work but postbacks will work as before.
Not necessarily as the AutoPostBack on a DropDownList (and many other ASP.NET controls) calls the __doPostBack function which is a JavaScript function. So those PostBacks would no longer work either.
As I mentioned, functionality that relies on JavaScript won't work but postback will occur. For example, if you place a button on your form while JS is disabled you will see that
the page still posts back. The reason for Ddl not being able to postback is that it calls into a JS function (__dopostback) and that function in turn submits the form. In fact, postback is not a JS concept and disabling JS won’t affect it.
As I mentioned, functionality that relies on JavaScript won't work but postback will occur. For example, if you place a button on your form while JS is disabled you will see that
the page still posts back. The reason for Ddl not being able to postback is that it calls into a JS function (__dopostback) and that function in turn submits the form. In fact, postback is not a JS concept and disabling JS won’t affect it.
I was just clarifying that the AutoPostBack property would no longer work on certain controls (in fact most controls excepting the ASP:Button), since in his original post he mentioned
The page has a dropdownlist with the states and has autopostback = true; That would no longer work.
I have RadioButtonList control with AutoPostBack="true". In this case Server side code is getting executed when JS is enabled in IE, but When I make JS DISABLE, server side code is not getting executed (not even LOAD event of page when click on other Radio
button) on IE.
Jahedx99
Member
501 Points
142 Posts
Javascript disabled and postback
Mar 26, 2008 04:25 AM|LINK
Just a quick question. If a page does postbacks or ajax methods using javascript, and a users pc has javascript disabled, then what are the consequences?
Lets say I make a project that has only one page. The page has a dropdownlist with the states and has autopostback = true;
Once the user chooses the state, it does a postback, and the server side code will excecute with Response.Write("You are from New York...");
In the same scenario, what would happen if the users pc had js disabled?
www.progtalk.com
nps
Participant
1774 Points
397 Posts
Re: Javascript disabled and postback
Mar 26, 2008 05:45 AM|LINK
Hi,
If javascript is disabled , then client side validators will not work, ajax wont work
Software Engineer
Reza A. Azim...
Member
38 Points
9 Posts
Re: Javascript disabled and postback
Mar 26, 2008 06:16 AM|LINK
http://mycomputerknowhow.blogspot.com
NC01
All-Star
82577 Points
15430 Posts
MVP
Re: Javascript disabled and postback
Mar 26, 2008 02:02 PM|LINK
Not necessarily as the AutoPostBack on a DropDownList (and many other ASP.NET controls) calls the __doPostBack function which is a JavaScript function. So those PostBacks would no longer work either.
NC...
Reza A. Azim...
Member
38 Points
9 Posts
Re: Javascript disabled and postback
Mar 27, 2008 06:05 AM|LINK
As I mentioned, functionality that relies on JavaScript won't work but postback will occur. For example, if you place a button on your form while JS is disabled you will see that the page still posts back. The reason for Ddl not being able to postback is that it calls into a JS function (__dopostback) and that function in turn submits the form. In fact, postback is not a JS concept and disabling JS won’t affect it.
http://mycomputerknowhow.blogspot.com
NC01
All-Star
82577 Points
15430 Posts
MVP
Re: Javascript disabled and postback
Mar 27, 2008 11:30 AM|LINK
I was just clarifying that the AutoPostBack property would no longer work on certain controls (in fact most controls excepting the ASP:Button), since in his original post he mentioned The page has a dropdownlist with the states and has autopostback = true; That would no longer work.
NC...
Meghna Godha...
Member
2 Points
1 Post
Re: Javascript disabled and postback
Feb 04, 2013 07:26 AM|LINK
Hi NC,
I have same issue in my project.
I have RadioButtonList control with AutoPostBack="true". In this case Server side code is getting executed when JS is enabled in IE, but When I make JS DISABLE, server side code is not getting executed (not even LOAD event of page when click on other Radio button) on IE.
Please help me out.
This site is managed for Microsoft by Neudesic, LLC. | © 2013 Microsoft. All rights reserved.
Follow Us On:
Microsoft