Can't get function to execute.
Hi,
I am new to JQuery. I was trying to get a very simple bit of code to execute and nothing happens. I am using VS 2010 and JQuery 1.4.1.
I created a sample ASP.Net web app project and added a button and a JQuery Click function. I have tried variations of it that I found on the net.
Can anyone see what I am doing wrong with the following?
Thanks.
Here's the complete code:
<%
@
Page
Title
="Home Page"
Language
="vb"
MasterPageFile
="~/Site.Master"
AutoEventWireup
="false"
CodeBehind
="Default.aspx.vb"
Inherits
="test3._Default"
%>
<
asp
:
Content
ID
="HeaderContent"
runat
="server"
ContentPlaceHolderID
="HeadContent">
<
script
src
="Scripts/jquery-1.4.1.min.js"
type
="text/javascript"></
script
>
<
script
type
="text/javascript">
$(
"#btnTest"
).click(
function
(event) {
alert(
"I see you!"
);
});
</
script
>
</
asp
:
Content
>
<
asp
:
Content
ID
="BodyContent"
runat
="server"
ContentPlaceHolderID
="MainContent">
<
h2
>
Welcome to ASP.NET!
</
h2
>
<
p
>
To learn more about ASP.NET visit
<
a
href
="http://www.asp.net"
title
="ASP.NET Website">
www.asp.net
</
a
>
.
</
p
>
<
input
type
="button"
id
="btnTest"
value
="Test"
/>
<
p
>
You can also find
<
a
href
=http://go.microsoft.com/fwlink/?LinkID=152368&clcid=0x409
title
="MSDN ASP.NET Docs">
documentation on ASP.NET at MSDN
</
a
>
.
</
p
> </
asp
:
Content
>