I am using asp.net c# with x-jquery-tmpl
So I am attempting to pass data to the code behind. I am generating a range of divs, based on some data, and assigning the name/values of the div using a template.
The problem I am having is that when the information is passed it is shown in the jquery form, and not showing the actual value.
<script id="SomeTemplate" type="text/x-jquery-tmpl">
<div class="grid_12">
<div class="box">
<div class="header">
<img alt="img" width="16" height="16" />
<h3>Title: ${text}</h3>
<div class="box" style="float:right; margin-top: -4px; margin-right: 8px" >
<asp:Button id="btn${text}" Text="${text}" runat="server" OnClick="RedirectPage" CommandArgument=${text} style="vertical-align:middle"/>
</div>
</div>
<div class="content">
<canvas id="cvs${text}" width="1600" height="750" style="border: 1px solid #222;">[No canvas support]</canvas>
</div>
</div>
</div>
</script>
When the button is clicked the behind code is executed:
protected void RedirectPage(object sender, EventArgs e)
{
Button test = (Button)sender;
string t = test.CommandArgument.ToString(); // returns $(text)
Response.Redirect("http://www.address.com/" + t);
}
The problem is that I want to use the value passed as part of my redirect.
Any help would be very much appreciated.
Thank you