简体   繁体   中英

Navigating to other page clicking on a image

I am new to .NET/ JS . I have an .aspx page where we will have to navigate to other page when clicking on the image on the table. The images should appear on every row, so I tried

  <input type="image" id="dataReview_' + templates[i].dataFileKey + '" title="Data Review" src="Images/datareview.png" style="height: 15px; width: 15px" onclick="dataReview_tasks(this); return false;"  />\n' +

So the icon appears like

![在此处输入图片描述

The table has different other columns with one filed is with check box. Now I am trying to navigate to other page when the icon is clicked on the table. Each row in the table corresponds to different values, so while clicking icon on one row we will sending those data in the table as the input to the other page. But right now I am trying to learn how to have link to other page from each icon the table without passing any values.

   function dataReview_tasks(obj) {
        var i = 0;
        var data_FileKeys = new Array();
        $('.chkImport')
            .each(function (index, value) {
                if ($(this).attr('checked')) {
                    var info = new IOInfo(this);
                    data_FileKeys[i] = info.key(0);
                    i++;
                }
            });
      *** I am not sure how to call the other page here****
     }

The page that needs to be called is ~/GUI/DataReview.aspx

Just change window's location as follows.

window.location = '/GUI/DataReview.aspx';

If your script is on the page, not in a separate javascript file, I highly recommend making ASP.NET to resolve your URL which makes your URL relative to root.

window.location = '<%= ResolveUrl("~/GUI/DataReview.aspx"); %>';

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM