View Full Version : How to put autopostback property true/false using javascript?

02-07-2012, 11:29 AM
Hi all,

i want code for "How to put autopostback property true/false using javascript".

02-07-2012, 04:05 PM
Since your question is general, so is this answer:

object.autopostback = some_condition

where object is some object that you want to set the autopostback property for and some_condition is either true or false or a statement which evaluates to either true or false depending upon current factors in the flow of the script.



states that there is no code for this in javascript (jscript is MS speak for javascript).

But you could try it. You should probably use the formal form:


though. Perhaps something like:

<input id="mytextbox" type="text" name="whatever">
<script type="text/javascript">
document.getElementById('mytextbox').AutoPostBack = true;

But, as I say, it's an ASP.NET thing. If you're using ASP.NET, why not use the code for this as described for ASP.NET or Visual Basic?