I have an aspx form called MyForm.aspx. In this form I had included a javascript file:
<script type="text/javascript" src="Scripts/MyForm.js"></script>
In MyForm.aspx.cs a have a property:
public string Username { get; set; }
How can I access this Username variable in the MyForm.js?
I tried in the following way but its not working:
var username = '<%=this.Username%>'
UserNameproperty have a value at the time being used?Usernameproeprty value from code-behind to your script, or some properties also? Show how theMyForm.jsorganized