Method 1. Using <a> label,
Front desk:
Copy Code code as follows:
<a href= ' <%# ' origimageshow.aspx?id=1&image_id= +eval ("id")%> ' id= ' tb_search ' runat= ' server ' target= ' _ Blank "> Pop-up </a>
<a href= ' Javascript:alert ("<%# origimageshow.aspx?image_id=" + Eval ("id")%> ") ' > Popup </a>
Use <a> tab, do not refresh main Page
Method 2.:asp:hyperlink
(1) Front desk: <asp:hyperlink id= "HyperLink" runat= "server" text= ' <%# Eval ("Operationflag")%> ' target= ' _blank ' > </asp:HyperLink>
Background binding path:
Copy Code code as follows:
protected void GridView1_RowDataBound (object sender, GridViewRowEventArgs e)
{
if (E.row.rowtype = = Datacontrolrowtype.datarow)
{
HyperLink Btnlink = (HyperLink) e.row.cells[3]. FindControl ("HyperLink");
HiddenField Hidderid = (HiddenField) e.row.cells[3]. FindControl ("log_id");//Get parameters to pass through hidden fields
String url = string. Empty;
if (Hidderid!= null)
{
url = "~/imagemanage/logpicdetails.aspx?id=" + Hidderid. Value;
Btnlink. NavigateUrl = URL;
}
}
}
(2) <asp:hyperlink id= "HyperLink1" runat= "server" Navigateurl= ' <%# ' origimageshow.aspx?image_id= ' + Eval ("ID")% > '
text= "pop-up" target= "_blank" ></asp:HyperLink>
Using Asp:hyperlink, the pop-up page does not refresh the main page
Method 3.asp:linkbutton
(1) Front desk: <asp:linkbutton id= "Tb_searchori" runat= "Server" text= "pop-up" onclientclick=<%# "window.open" (' Origimageshow.aspx?image_id= "+eval" ("id") + "')"%> ></asp:LinkButton>
(2) Front desk: <asp:linkbutton id= "Tb_searchori" runat= "Server" text= "pop-up" onclick= "Lb_ori_click" commandargument= "<%#" Bind ("ID")%> ' ></asp:LinkButton>
Copy Code code as follows:
protected void Lb_ori_click (object sender, EventArgs e)
{
LinkButton lbtn = (LinkButton) sender;
int imgid = Int. Parse (Lbtn.CommandArgument.ToString ());
String url = "origimageshow.aspx?image_id=" + imgid;
url = page.resolveurl (URL);
Page.ClientScript.RegisterStartupScript (Page.gettype (), "Messid", "<script language= ' JavaScript ' > window.open (' "+ URL +" ');</script> ");
}
Use Asp:linkbutton to refresh the home page after a pop-up
To sum up: recommend the use of hyperlink or a way