简体   繁体   中英

Redirecting a page into the same tabbed window using JavaScript?

I have a problem , I am quite new to this whole coding in cross languages , basically when I click on a row index in my GridView it then opens a new tab and brings in the results in that window ( The new one that has just opened ) and I know this is from using the Window.Open but I am wondering is there a function that I can use to just open my results in the actual same window from where it is being clicked? something like Window.Open <Open in same window> ? My code is below.

Protected Sub GridView1_RowDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GridView1.RowDataBound If e.Row.RowType = DataControlRowType.DataRow Then e.Row.Cells(1).Attributes("onmouseover") = "this.style.cursor='hand';this.style.textDecoration='underline';" e.Row.Cells(1).Attributes("onmouseout") = "this.style.textDecoration='none';" Dim Index As Integer = e.Row.RowIndex e.Row.Cells(1).Attributes("OnClick") = "window.open('MachineSweepLite.aspx?AreaID=" + GridView1.DataKeys(e.Row.RowIndex).Values("ID").ToString + "');" End If End Sub

Please make your answers Clear as possible for me to understand.

代替window.open()使用window.location.href如下所示

 window.location.href = 'http://www.google.com';

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