复制代码 代码如下:
<a href='<%# "OrigImageShow.aspx?id=1&image_id="+Eval("ID")%>' runat="server" target="_blank"> 弹出 </a>
<a href='Javascript:alert("<%# OrigImageShow.aspx?image_id=" + Eval("ID")%>")'>弹出</a>
复制代码 代码如下:
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");//通过隐藏域获取要传递的参数
string url = string.Empty;
if (hidderid != null)
{
url = "~/ImageManage/LogPicDetails.aspx?id=" + hidderid.Value;
btnlink.NavigateUrl = url;
}
}
}
复制代码 代码如下:
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>");
}
新闻热点
疑难解答
图片精选