Hi,
I have been doing all the exercises building the Wrox website. I followed the directions in this "Try It Out" on page 370 and when I open the JQuery demo in the browser, I do not see any change in the background color of the MainContent div and nothing seems to happen when I click the Button. Also, I tried changing the theme, and apparently something is wrong because the theme does not change.
This is the code for the JQuery Demo:
Code:
<%@ Page Title="jQuery Demo" Language="C#" MasterPageFile="~/MasterPages/Frontend.master"
AutoEventWireup="true" CodeFile="jQuery.aspx.cs" Inherits="Demos_jQuery" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="cpMainContent" runat="Server">
Este espacio es el main content area.
<input id="Button1" type="button" value="button" />
<script type="text/javascript">
$(document).ready(function ()
{
$('#MainContent').css('background-color', 'green')
$('#Button1').click(function ()
{
$('#MainContent').css('background-color', 'red')
.animate({ width: '100px', height: '800px' })
});
});
</script>
</asp:Content>
And this is the code I added to the Frontend.master:
Code:
<form id="form1" runat="server" enableviewstate="True">
<asp:ScriptManager ID="ScriptManager1" runat="server" EnablePageMethods="True">
<Scripts>
<asp:ScriptReference Path="~/Scripts/jquery-1.4.1.min.js" />
</Scripts>
</asp:ScriptManager>
<div id="PageWrapper">
I compared very carefully with the final code you provide in the Chapter 11 Resources.
Thank you.