0
votes

i am getting this error when the below condition match, i am using the below code in Content page and in my master page i have this

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

Error: Microsoft JScript runtime error: Object expected

 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);
 }
1
if you have JavaScript function on your page, put Return False, stackoverflow.com/questions/855360/… - Safi

1 Answers

1
votes

This is typically caused when a jscript function cannot be resolved. Do you have a reference to the JQuery library containing the jAlert function?