Click here to Skip to main content
15,906,645 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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.NET
<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
JavaScript
<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)'
                                 }
                                 // series: [{
                                 //     type: 'column',
                                 //     name: 'Jane',
                                 //     data: [3, 2, 1, 3, 4]
                                 // }, {
                                 //     type: 'column',
                                 //     name: 'John',
                                 //     data: [2, 3, 5, 7, 6]
                                 // }, {
                                 //     type: 'column',
                                 //     name: 'Joe',
                                 //     data: [4, 3, 3, 9, 0]
                                 // },
                                 //]
                             });

                         }
                     });
                 }

    </script>


now how i call these id in form2.aspx to display data in form2.aspx?
Posted
Comments
Karthik_Mahalingam 27-Aug-16 2:43am    
do you want to open the form2 as popup window or new page
super_user 27-Aug-16 2:58am    
want to open form2.aspx as a new page in new tab
Karthik_Mahalingam 27-Aug-16 5:37am    
pass the data in query string and access it in next page.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900