i have two forms . form1.aspx and form2.aspx.
Now all code in form1.aspx
There is dropodwn fromdate to date and tabledata id in form1.aspx so when i select value from dropdown and datepicker and click on button then data is display in table in form1.aspx and when i click on any record in table then grpah is displayed on form1.aspx
now i want when i click on record in table then i want to open this graph in form2.aspx how i do this
form1.aspx
<asp:DropDownList ID="regiondrop" runat="server" AutoPostBack="True"
onselectedindexchanged="regiondrop_SelectedIndexChanged">
</asp:DropDownList>
<input ID="fromdate" value="dd/mm/yyyy" runat="server" clientidmode="static" />
<input ID="todate" value="dd/mm/yyyy" runat="server" clientidmode="static" />
<input type="button" id="search_data" class="sear_btn" value="Search Data" />
What I have tried:
this is code for display graph in form1.aspx
<script type="text/javascript">
$(function () {
$('#tabledata').on('click', 'tr', function () {
var row = $(this);
var regno = row.find('td')[0].firstChild.data;
var fromdate = $('[ID*=fromdate]').val();
var todate = $('[ID*=todate]').val();
var obj = {};
obj.RegNo = regno;
obj.fromdate = fromdate;
obj.todate = todate;
Getsumdata(obj);
return false;
});
});
function Getsumdata(obj) {
$.ajax({
type: "POST",
url: "WebForm1.aspx/summarydata",
data: JSON.stringify(obj),
contentType: "application/json;charset=utf-8",
dataType: "json",
async: true,
cache: false,
success: function (result) {
alert(JSON.stringify(result.d));
console.log(JSON.stringify(result.d));
var data1 = result.d.split('*')[0];
console.log(JSON.stringify(data1));
var data2 = result.d.split("*")[1];
console.log(JSON.stringify(data2));
alert(data1);
alert(data2);
$('#sum').highcharts({
chart: {
type: 'column'
},
title: {
text: 'Combination chart'
},
xAxis: {
categories:eval(data1),
title: {
text: null
}
},
labels: {
items: [{
html: 'Total fruit consumption',
style: {
left: '50px',
top: '18px',
color: (Highcharts.theme && Highcharts.theme.textColor) || 'black'
}
}]
},
series: eval(data2),
pointRange:120 * 3600 * 1000,
regresson: true,
regressionSettings: {
type: 'linear',
color: 'rgba(223, 83, 83, .9)'
}
});
}
});
}
</script>
now how i call these id in form2.aspx to display data in form2.aspx?