how get hidden field value from repeater and call .cs method using javascript

Posted by Cpatil1000 under ASP.NET on 9/29/2016 | Points: 10 | Views : 380 | Status : [Member] | Replies : 0
hi,
I am using repeater. in the repeater i am using anchor tag and hidden field. in hidden field storing status_id. When i click anchor tag i am calling javascript function. but i am not geeting refresh google refresh chart. because it not calling .cs method. i am passing hidden value to .cs
method.. how to do this..
javascript function
==================
 function showFarmerStatusChart(myStatus) {
drawChart(); var detailHead = document.getElementById('<%=dDetailHead.ClientID%>'); detailHead.style.display = 'none';
}
<script type="text/javascript">
google.load("visualization", "1", { packages: ["corechart"] });
//Do not call this method on pageload
//google.setOnLoadCallback(drawChart);

function drawChart() {
var farmerChartList = document.getElementById('<%=lbFarmerList.ClientID%>');
farmerChartList.style.display = "block";

var activityChartList = document.getElementById('<%=lbActivityList.ClientID%>');
activityChartList.style.display = "none";

var data = new google.visualization.DataTable();

data.addColumn('string', 'Status');
data.addColumn('number', 'TotalStatus');

data.addRows(2);

<%=SetFarmerChart()%>;

var chart = new google.visualization.PieChart(document.getElementById('chart'));

chart.draw(data, { title: 'Farmer Status Details', titleTextStyle: { color: 'Maroon', fontSize: '20', fontStyle: 'normal' }, is3D: 'true', tooltip: { text: 'value' }, pieSliceText: 'value', legend: 'right', width: 540, height: 320 });
}
</script>

aspx;
<div class="container" style="width: 265px; float: left; margin-left: -10px; margin-top: 05px;">
<ul class="list-group">
<li class="list-group-item active" style="background: #eeeeee; color: Black;"><span class="badge">
<asp:Label ID="lbTotalStatus" runat="server"></asp:Label></span>Status</li>
</ul>
<asp:UpdatePanel ID="upstatusp" runat="server">
<Triggers>
<asp:PostBackTrigger ControlID="rpStatus" />
</Triggers>
<ContentTemplate>
<asp:Repeater ID="rpStatus" runat="server" ClientIDMode="Static">
<HeaderTemplate>
<ul class="list-group" style="margin-top: -20px;">
</HeaderTemplate>
<ItemTemplate>
<li class="list-group-item" style="font-size: 13px;" runat="server"><a href="#" id="anStatusID">
<%#Eval("STATUS")%>
</a>
<asp:HiddenField ID="hfStatusID" runat="server" Value='<%#Eval("STATUS_ID")%>' />
<span class="badge">
<%# Eval("TOTAL_STATUS")%></span> </li>
</ItemTemplate>
<FooterTemplate>
</ul>
</FooterTemplate>
</asp:Repeater>
</ContentTemplate>
</asp:UpdatePanel>
</div>





Responses

(No response found.)

Login to post response