Visual Studio 2010 jquery and ScriptManager throw an error

I just installed a new visual studio 2010, and when I create a new form and add jquery avaliable and scriptmanager, then firefox shows me eror Sys.ArgumentException: element with identifier 'form1' not found. Parameter Name: elementOrElementId

looks like that:

<%@ 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> 
+4
source share
2 answers

Instead:

 <script src="Scripts/jquery-1.4.1.js" type="text/javascript" /> 

make:

 <script src="Scripts/jquery-1.4.1.js" type="text/javascript"></script> 

Also, the jQuery $ function may conflict with MsAjax, so be sure to read about noConflict if you plan to use jQuery. Or even better, because you plan on using jQuery to remove the MsAjax and script managers. They don’t need you.

+9
source

Add EnablePartialRendering = "false" for the screenwriter

Your aspx page will have the code below

 <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <meta name="viewport" content="width=device-width" /> <title>my Test page</title> </head> <body> <form id="form1" runat="server"> <div> <asp:ScriptManager ID="ScriptManager1" runat="server" EnablePartialRendering="false"></asp:ScriptManager> <rsweb:ReportViewer ID="ReportViewer1" runat="server" AsyncRendering="false" Width="100%" ShowToolBar="false"> </rsweb:ReportViewer> </div> </form> </body> </html> 
0
source

Source: https://habr.com/ru/post/1347280/


All Articles