简体   繁体   English

导航到其他页面,单击图像

[英]Navigating to other page clicking on a image

I am new to .NET/ JS . 我是.NET / JS的新手。 I have an .aspx page where we will have to navigate to other page when clicking on the image on the table. 我有一个.aspx页,单击表上的图像时,我们必须在其中导航到其他页面。 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 需要调用的页面是〜/ 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. 如果您的脚本在页面上,而不是在单独的javascript文件中,则我强烈建议您使用ASP.NET来解析您的URL,这使您的URL相对于root。

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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