jquery wont fire in asp.net using telerik controls
I have a simple page that I need to open the print dialog on once the page has completed loading and I was going to achieve this using jquery, however I don't seem to be able to get my jquery to run.
I have followed the guide on Telerik, as we are using their controls and for simplicity I'd like to not have to introduce more than one version of jQuery unless its absolutely neccessary which I don't think it is.
I have tried a few of the methods listed there and none seem to work, replacing the jquery with just a normal JS alert works though.
This is the code:
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Print.aspx.cs" Inherits="Web.Modules.Plan.Print"
Theme="Plan" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Print Your plan</title>
<script type="text/javascript">
$(document).ready(function () {
alert("Document is ready");
});
</script>
</head>
<body>
<form id="form1" runat="server">
<telerik:RadScriptManager runat="server" ID="RadScriptManager" >
<Scr开发者_运维技巧ipts>
<asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.Core.js" />
<asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQuery.js" />
<asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQueryInclude.js" />
</Scripts>
</telerik:RadScriptManager>
<div>
<div id="divInstrumentTitle" runat="server" class="InstrumentTitle">
<asp:Label runat="server" ID="lblInstrumentTitle" CssClass="InstrumentTitle" /></div>
<asp:Panel runat="server" ID="pnlEplan" />
</div>
</form>
</body>
</html>
any ideas as to whats going on here?
Try moving your scripts below the RadScriptManager, so move them out of the head into the body, at the end of the form, to test to see if that makes a difference.
精彩评论