2010-08-04 87 views
0

我收到的時候下面的條件匹配,我使用下面的代碼在內容頁面,並在我的母版頁這樣的錯誤,我有這個微軟JScript運行時錯誤:預期的對象

<asp:ScriptManager EnablePartialRendering="true" EnablePageMethods="true" ID="smgr" runat="server" /> 

錯誤:Microsoft JScript中的運行時錯誤:預期的對象

if (lstRecipient.Items[i].Text == ddlRecipient.SelectedItem.Text) 
{ 
    lstRecipient.Items.RemoveAt(i); 
    isDuplicate = true; 
    ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "AlertAdd", "jAlert('Recipient name is already in the list.', 'Duplicate Entry!');", true); 
} 
+0

如果您的頁面上有JavaScript功能,請將Return False,http://stackoverflow.com/questions/855360/when-and-why-to-return-false-in-javascript – Safi 2011-06-27 12:35:05

回答

1

這通常導致當JScript函數不能得到解決。你有沒有對包含jAlert函數的JQuery庫的引用?

+0

我在我的主人頁。 – 2010-08-04 17:53:08

+0

@Nisar Khan - 你能否確認圖書館是使用像Firebug這樣的工具加載的?路徑是正確的?如果將代碼更改爲Javascript警報,會發生什麼情況?現在有用嗎?正在生成的腳本塊是什麼樣的?想要嘗試的一些想法。 – DaveB 2010-08-04 18:08:40

+0

我的腳本在「」中,我將這些腳本移動到部分,現在它的工作。 – 2010-08-04 18:37:03

相關問題