2

I have an ASP.NET 4 web app. I am using a Master Page Site.Master. The head of the master page is:

<head runat="server">
<title></title>
<script type="text/javascript" src="http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.4.4.js">
</script>
<script type="text/javascript" src="http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.4.4-vsdoc.js">
</script>
<link href="~/Styles/Site.css" rel="stylesheet" type="text/css" />
<asp:ContentPlaceHolder ID="HeadContent" runat="server">
</asp:ContentPlaceHolder>
</head>

Currently in the content page, I have:

<asp:Content ID="HeaderContent" runat="server" ContentPlaceHolderID="HeadContent">
<% if (false)
   { %>
<script type="text/javascript" src="http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.4.4.js"></script>
<% } %>
<script type="text/javascript">
    $(document).ready(function () {
        alert("Welcome jQuery !");
    });
</script>
<script type="text/javascript">
function Blam() { alert("Welcome jQuery !"); }; </script>

My content Page must show an alert when a button "ViewButton" is pressed! i,e, the ViewButton must call function Blam! How do I do that??

If I run this code, I get an exception:

readyBound is not defined!

The exception is in file: jquery-1.4.4-vsdoc.js The call stack is: bindReady JScript ready JScript JScript global code JScript

manishKungwani
  • 925
  • 1
  • 12
  • 44

2 Answers2

4

Don't include jquery-1.4.4-vsdoc.js in your actual site; it is not meant to be functional.

Visual Studio should automatically read that the vsdoc when you include jquery-1.4.4.js.
Alternatively, you can include the vsdoc inside an if (false).

SLaks
  • 868,454
  • 176
  • 1,908
  • 1,964
2

You don't need to include the vsdoc file on your web page - it just needs to be in the same folder as your jquery file and just provides intellisense for Visual Studio.

Tim Rogers
  • 21,297
  • 6
  • 52
  • 68