2011-02-02 81 views
0

我嘗試使用window.open finction彈出,但不知它不工作...遠低於是代碼window.open功能href標記不工作

string properties = "left=250px, top=245px, width=700px, height=450px,scrollbars=yes, status=yes, resizable=yes"; 
TableCell cell = new TableCell(); 
cell.Text = "<a href=\"javascript:void(window.open('details.aspx?node="+node+"','"+properties+"'))\">" + "View Details</a>";  

但他不工作。點擊獲取javascript錯誤的錨標籤「無效參數」。請告訴我哪裏錯了?

感謝, 拉胡爾

+0

我看你有沒有一些問題接受的答案。請回到以前的問題,並接受任何好的答案(投票數旁邊的綠色勾號) – 2011-02-02 23:28:18

回答

0

你就錯了。切勿將JavaScript放入href屬性中。這是你應該怎麼做:

<a href="details.aspx?..." onclick="window.open(this.href, 'mypopup'); return false;">View Details</a> 

我說的第二個參數爲window.open(窗口標識符)爲好,這大概是什麼打破你的東西擺在首位。

0
<a href="?i=1" id ="a" runat = "server"> 

on Page_load() 
if (Request.QueryString["i"] == "1") 
{ 
//call ur code here 
AreaFootPrint_Click(null,null); 
}