开发者

!IsPostBack event from Javascript

开发者 https://www.devze.com 2023-01-28 17:21 出处:网络
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.

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

精彩评论

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

关注公众号