我的JavaScript代码是这样的:发送查询字符串变量,新弹出的窗口
var newwindow;
function poptastic(url) {
newwindow = window.open(url, 'name', 'height=400,width=200');
if (window.focus) { newwindow.focus() }
}
而且我的C#代码:
foreach (GridViewRow row in GvComments.Rows)
{
Button btnReplay = (Button)row.FindControl("btnReplay");
string url = "javascript:poptastic('Configuration.aspx?id=" + e.CommandArgument + "')";
btnReplay.Attributes.Add("onclick", url);
}
我认为C#代码有问题,因为当我使用这个JavaScript代码在它的工作标签中,但在attribute.add
无法正常工作。
为什么这是标记[标签:java],而不是[标签:c#]? –
我猜java脚本代码有问题.. –
你能显示生成的HTML? –