I have an ASP webpage which I am trying to write some javascript in...
I want to set a variable to the response of a function - which is stored in my code behind (page.aspx.vb).
this is an example of what I am trying to do:
<script type='text/javascript'>
var test ='<%GetTestName()%>'
</script>
I run this page - which does call the method GetTestName()... but does not set the variable 'test' to the response. In the dynamic view, I can just see that this line of JavaScript now says:
<script type='text/javascript'>
var test =''
</script>
This method is used a number of times in this ASP listview control - and works fine. For example:
<ItemTemplate>
<div class="rlvI" style="height:100px; width:100px; margin-top:0px; margin-left:5px; margin-right:5px; margin-bottom:25px; background-color:<%# GetRowColor(Container.DataItem)%>; color:white">
<asp:Button ID="SelectButton" runat="server" CausesValidation="False" CommandName="Select" CssClass="rlvBEdit" Text=" " ToolTip="Select" />
<asp:Label ID="measure" runat="server" Text='<%# Eval("measure")%>' />
<br />
<asp:Label ID="actualLabel" runat="server" Text='<%# String.Concat("A: ", Eval("actual"))%>' />
<br />
<asp:Label ID="budgetLabel" runat="server" Text='<%# String.Concat("B: ", Eval("budget"))%>' />
<br />
</div>
</ItemTemplate>
Is this not possible in javascript? And if not can you suggest a better way to do it?
Thanks in advance.