!IsPostBack event from Javascript
I am using ASP.NET
I have to set th开发者_Python百科e value of a variable [testVar]
into Javascript on page load. only for the first time when the page load. Just like !IsPostBack
event on code side.
From next postback this function of Javascript should not call. Please let me know how to implement it.
Add this line to your ASPX page:
<% if (!this.IsPostBack) %>
<% { %>
<script type="text/javascript">
document.getElementById("<%= this.timeVar.ClientID %>").value = '1/1/2010';
</script>
<% } %>
精彩评论