protected void gvShowOut_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
//单击/双击 事件 e.Row.Attributes["ondblclick"] = String.Format("javascript:dbl_click=true;window.open('Leave.aspx?flowInId={0}&fI_H_ID={1}','_blank','height=540, width=750px, top=100, left=100, toolbar=no, menubar=no, scrollbars=no, resizable=no,location=no, status=no');", gvShowOut.DataKeys[e.Row.RowIndex].Values["FlowIn_ID"].ToString(),gvShowOut.DataKeys[e.Row.RowIndex].Values["FI_H_ID"].ToString());
e.Row.Attributes["title"] = "双击打开详细页面"; }
我第一个值得到了,就是第二个值无法得到。老是提示字符串格式不正确!请高手赐教.
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
//单击/双击 事件 e.Row.Attributes["ondblclick"] = String.Format("javascript:dbl_click=true;window.open('Leave.aspx?flowInId={0}&fI_H_ID={1}','_blank','height=540, width=750px, top=100, left=100, toolbar=no, menubar=no, scrollbars=no, resizable=no,location=no, status=no');", gvShowOut.DataKeys[e.Row.RowIndex].Values["FlowIn_ID"].ToString(),gvShowOut.DataKeys[e.Row.RowIndex].Values["FI_H_ID"].ToString());
e.Row.Attributes["title"] = "双击打开详细页面"; }
我第一个值得到了,就是第二个值无法得到。老是提示字符串格式不正确!请高手赐教.
gvShowOut.DataKeys[e.Row.RowIndex].Values["FI_H_ID"]
包含特殊字符,比如说 & < 等等
需要调用 this.Page.Server.UrlEncode(gvShowOut.DataKeys[e.Row.RowIndex].Values["FI_H_ID"].ToString())
e.Row.Cells[0].Attributes.Add("ondoubleclick", "location.href='../Preview/Preview.aspx?a=" + param + "';return false;");
用 e.Row.Cells[1].Text,取值