开发者

!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>
<% } %>
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜