日期:2014-05-17 浏览次数:20481 次
if (e.Row.RowType == DataControlRowType.DataRow)
{
Button btn3 = (Button)e.Row.FindControl("Button3");
btn3.CommandArgument = e.Row.Cells[2].Text.ToString();
String s = "javascript:showPopWin(\'详情修改\',\'g_default.aspx?CMD=AddEqp&IDX=" + btn3.CommandArgument + "\')";
btn3.Attributes.Add("onclick", s);
Button btn4 = (Button)e.Row.FindControl("Button4");
btn4.CommandArgument = e.Row.Cells[2].Text.ToString();
}
<input type="submit" name="GridView1$ctl04$Button3" value="添加器具" onclick="javascript:showPopWin('详情修改','g_default.aspx?CMD=AddEqp&IDX=27');" id="GridView1_ctl04_Button3" />其中单引号被转义,如何让单引号输入仍然是单引号不被转义?我也是这用@了,还是被转义。
this.btnCalculate.Attributes.Add("onclick", @"PopWin()");
ClientScript.RegisterStartupScript(this.GetType(), "btnClick", "<script type='text/javascript'>function PopWin(){//弹出窗口代码}</script>");