我的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? –