How to pass an html td onclick event value in wcf service url forkendo ui in asp.net application?

  • Thread starter Thread starter arpitamehta.ce
  • Start date Start date
A

arpitamehta.ce

I have an asp.net application in which I am using kendo ui charts. I have a html table in the aspx page and I am storing the html td onclick value in a hiddenfield control like this,

<table class="window" style="margin-top: 15px; text-align: center;">
<tr id="NavMonth">
<td id="m1" onclick="">
Jan
</td>
<td id="m2" onclick="">
Feb
</td>
<td id="m3" onclick="">
Mar
</td>
</tr>
</table>


<script type="text/javascript">
$(document).ready(function () {
$('.window td').on('click', function () {
var idName = this.id;
$('#hidden').val(idName);
});
});
</script>

Now I want to pass this hiddenfield value to a wcf service url so that I can show the charts as per the month selected by the user,

dataSource: {
transport: {
read: {
url: "http://<%=strWcfServer%>/WcfService1/Service1.svc/Total_Product_Count_Monthly?month=<%=month_number%>",
dataType: "json"
}
}
}

But this month_number variable has to be a global variable in the aspx.cs page and I have the month number in a hiddenfield.

How can I store this month_number value from hiddenfield to a global variable so that it can be passed to a wcf service or is there any other option to pass the selected month to the wcf service?

Thanks.
 
Back
Top