Wrox Programmer Forums
|
BOOK: Professional ASP.NET 2.0 AJAX ISBN: 978-0-470-10962-5
This is the forum to discuss the Wrox book Professional ASP.NET 2.0 AJAX by Matt Gibbs, Dan Wahlin; ISBN: 9780470109625
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Professional ASP.NET 2.0 AJAX ISBN: 978-0-470-10962-5 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old September 3rd, 2007, 03:23 AM
Registered User
 
Join Date: Jul 2004
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default First code sample does not work

The code same called "BasicUpdatePanel.aspx" does nothing when I load it into my local web server. I am running IIS5 locally. I click the buttons and .... zip!

Nothing happens. No postback no nothing. Any suggestions please?

Many thanks
Tomo
 
Old September 3rd, 2007, 03:53 AM
Registered User
 
Join Date: Jul 2004
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hmm it seems I may have bought the wrong book. I am a total noob at ajax.

However, code samples given in the professional book should give you complete code to run the sample.

I would still like to be able to run the first code sample. It looks like this:

Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<script runat="server" language="C#" >
    protected override void OnLoad(EventArgs e) {
        base.OnLoad(e);
        string theTime = DateTime.Now.ToString();
        for (int i = 0; i < 3; i++) {
            theTime += "<br />" + theTime;
        }
        time1.Text = theTime;
        time2.Text = theTime;
    }
</script>

<html xmlns="http://www.w3.org/1999/xhtml" >
<head id="Head1" runat="server">
    <title>Basic Update Panel</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
    <asp:Label runat="server" ID="time1"></asp:Label><br /><br />
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
   <ContentTemplate>
       <div style="border-style:solid;background-color:gray;">
         <asp:Label runat="server" ID="time2"></asp:Label><br />
         <asp:Button ID="Button1" runat="server" Text="Inside Button" />
         </div><br />
   </ContentTemplate>
</asp:UpdatePanel>
    <asp:Button ID="Button2" runat="server" Text="Outside Button" />
</div>
</form>
</body>
</html>
The first thing I noticed was there were no button click events.

Many thanks
Tomo
 
Old September 29th, 2007, 11:56 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 917
Thanks: 0
Thanked 0 Times in 0 Posts
Default

You said IIS5, but I think you meant IIS6? The code works for me. Did you install the ASP.NET Extensions correctly?

What happend if you build the project - any errors?

Eric

 
Old October 5th, 2007, 05:22 PM
Authorized User
 
Join Date: Apr 2007
Posts: 16
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I just went through the same thing. Look in the code behind. I had to add my own code to get it to work:
Code:
   
protected void Button2_Click( object sender, EventArgs e )
     {
          time1.Text = DateTime.Now.ToString();
     }
     protected void Button1_Click( object sender, EventArgs e )
     {
          time2.Text = DateTime.Now.ToString();
     }
 
Old December 7th, 2008, 03:22 AM
Registered User
 
Join Date: Dec 2008
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks working fine for me too.






Similar Threads
Thread Thread Starter Forum Replies Last Post
want sample code mohiddin52 Access VBA 2 December 16th, 2006 04:54 AM
Need Sample code okshilato SQL Server 2005 0 March 28th, 2006 10:41 AM
Sample Code mirouvor Java Databases 1 January 2nd, 2006 02:28 PM
Can't make sample project work [email protected] All Other Wrox Books 1 August 17th, 2004 03:02 AM
Where the sample code? rbtcx BOOK: Professional C#, 2nd and 3rd Editions 5 August 21st, 2003 02:58 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.