PDA

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



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

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

jscheuer1
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.

However:

http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.textbox.autopostback.aspx

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:

AutoPostBack

though. Perhaps something like:


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

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?