| Subscribe via RSS

Is it too late to say I love jQuery too?

November 5th, 2007 | Comments Off | Posted in ASP.NET, Ajax

jQuery is lightweight javascript framework with lots of support on the net and a big library of plug ins. Given the amount of client side content that is going to be knocking around in Visual studio 2008, I’d say it’s a good time to brush up on your jscript skills. While you are at it, make sure you check out this library to give you a leg up. Communication between jQuery and ASP.NET is a breeze and as a quick example, this is what you need to get inline editing going with very little effort at all.

You will need:
jQuery
jEditable

First the .aspx
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head runat="server">
<title>Untitled Page</title> 
<script src="jquery.js" type="text/javascript"></script> 
<script src="jeditable.js" type="text/javascript"></script> 
<script type="text/javascript">$(document).ready(
function(){ $("p").editable( "http://localhost:3684/test/handler.ashx", { type: 'textarea',cancel: 'Cancel',indicator:"test.jpg", submit:'ok'});
});</script>
 </head>
<body>
<form id="form1" runat="server">
<div>
</div>
<p>yes you are now rocking with the best</p>
</form>
</body>
</html>

 

and you will need a httphandler to save the edits. For this example, I’m just writing the data back out without storing it.

<%@ WebHandler Language=“C#” Class=“handler” %> using System;using System.Web; public class Echo : IHttpHandler {public void ProcessRequest (HttpContext context) {context.Response.ContentType = “text/plain”;context.Response.Write(context.Request.Params["Value"]);}public bool IsReusable {get {return false;}} }

 

And that’s it. Inline editing with jQuery and ASP.NET. Simple!

PS if you want to know why there has not been much action on the blog this month, blame this.

Book Review: Professional ASP.NET 2.0 AJAX

July 30th, 2007 | Comments Off | Posted in ASP.NET, Ajax

proAjaxBook I’ve been knocking together a little hobby project that contains plenty of AJAX, both the ASP.NET and rolled-from-scratch variety, and needed something to act as a bit of a reference to get me through some of the more non-obvious attributes and properties, so I spotted this on Amazon and went for it. I’ve got to say, that when it arrived, it was a bit of a shock. This is the thinnest technical book I’ve ever bought, compared with other Wrox publications it just looks puny!

To be honest, a lot of the content is a bit puny too. Maybe it’s just me being a bit to eager, but i already knew about 75% of the content just from my Internet based studies. The chapter of the AJAX Toolkit is particularly thin and doesn’t cover anywhere near as much functionality as one would expect.

On the other hand, the chapters on debugging and testing, deployment and building AJAX based customer controls are particularly illuminating. To sum up, I’d say this was a decent introduction to the subject, but not something that deserves a ‘Professional’ title added to it. A half decent weekend read, 6 out of 10. More at Amazon.co.uk…

AJAX.ASP.NET library interop

July 16th, 2007 | 1 Comment | Posted in ASP.NET, Ajax

I’ve messed around quite a bit with the ‘Atlas’ libraries in the past, and only recently have I had a real reason to play with the updated and re-badged Ajax.Asp.Net libs. My main frustration with the old libraries was that the system threw a wobbler if you tried to use it in conjunction with one of the shockingly good pre-built javascript libraries such as prototype or scriptaculous.
It’s good to see that Microsoft has gone a long way to code their way around code base clashes and are a member of the OpenAjax Alliance, dedicated to interoperability amongst libraries.
Anyway, here’s a brand new how-to video that has only just appeared on the official AJAX.ASP.Net site.

  • Cloud

    Ajax AmpliFeeder ASP.NET Blabnote C# Cloud Design EntityFramework Framework JavaScript JQuery LINQ Live Mesh MicroBlog Mix07 Mobile Productivity Rails Remix08 SDS Silverlight2 SQL SSDS TDD Telecommunications Uncategorized VOIP WCF Web 2.0 Webcast

  • @jonpauldavies