I try to show variable value like this:
<% userTotalCount.ToString(); %>
But I understand that at the start the value is null, that's why I can't see anything on the page. Value of userTotalCount
Variable sets later in Page_Load()
event. How to show this value after it being set.
The error is that you do not render the value. To render it on page use (note the first <%=
)
<%= userTotalCount.ToString(); %>
this is a short cut for
<% Response.Write(userTotalCount); %>
The value is set on PageLoad, then come back to render there, so you have it, but you do not render it.
You can also read : how to display variable value in asp.net which is set in Page_Load function
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With