i've just installed new visual studio 2010, and when i create new form and add jquery avaliable and scriptmanager then firefox shows me an eror Sys.ArgumentException: An element with id 'form1' could not be found. Parameter name: elementOrElementId
form looks like this
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm1.aspx.cs" Inherits="WebApplication1.WebForm1" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<head runat="server">
<title></title>
<script src="Scripts/jquery-1.4.1.js" type="text/javascript" />
</head>
<body>
<form id="form1" runat="server">
<asp:ScriptManager ID="ScriptManager1" runat="server" />
<div>
</div>
</form>
</body>
</html>
Instead of:
<script src="Scripts/jquery-1.4.1.js" type="text/javascript" />
do:
<script src="Scripts/jquery-1.4.1.js" type="text/javascript"></script>
Also jQuery's $
function might conflict with MsAjax so make sure you read about noConflict
if you are planning on using jQuery. Or even better, because you plan to use jQuery throw away MsAjax and script managers. You don't need them.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With