Hey,

 

I am trying to learn JQuery using ASP.Net and VS2010.  I created a web app
from the new project thing and added one button and one JQuery item.  I
cannot get it to work.  I know there are some developers on this list and
wanted to throw out what I have done to see if anyone sees anything wrong
with the code.  I have looked at examples on the net and it looks like I am
doing it correctly.  But It will not show the alert.

 

The items in yellow are the code that I added.

 

Thanks in advance,

Bobby

 

<%@ 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 am here!");

        });

 

    </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&amp;clcid=0x409";

            title="MSDN ASP.NET Docs">documentation on ASP.NET at MSDN</a>.

    </p>

</asp:Content>

 

 

Reply via email to