I’ve just started my journey into the land of JavaScript for real and am learning things most of you already know. For example, as the Silicon Valley Code Camp coordinator and web site author, I just recently decided to add a Virtual Earth Map showing attendees and speakers (see the home page). I wrote a simple web response handler that returns all the data in JSON so I could plot the data. Then, after a couple searches on the web, I found a way to send a request to the service asynchronously and get the result. The code looks something like this:
(more…)
http://www.linqpad.net/ – Use with Microsoft .Net for building Query type expressions with LINQ
I’m not a wizard at writing LINQ expressions so I often find myself in Google looking for something similar to what I want, then I put it into my application and run it. This has worked pretty well, but it takes a couple iterations to get it right. It occured to me that someone probably has written a LINQ interpreter so I just guessed the name, LINQPad, typed it into search, and I find the authors of the book C# 3.0 in a nutshell, Joseph Albahari and Ben Albahari, (which I like a lot) have written it.
(more…)
Microsoft has made building a WCF Web Service to communicate with JavaScript very easy in Visual Studio 2008. In this post, I’ll go through the basics of building this app and demonstrate it working. Included is the project file which might be a help so you can run it yourself. I have found a lot of other posts on the web about this same topic but have had little luck getting the code to work. Few authors post projects with actual working code. I try to as often as I can because I know how frustrating it can be to not be able to get something working.
Code Associated With this Article Visual Studio Project
First, create an ASP.NET 3.5 Web site. That is, go into File / New Website and choose ASP.NET Web Site.
Then, Add a new Item to the root of the project called WCF Service and name it SimpleService.svc.
(more…)
I’ve just started (within the past 2 days) learning and building a prototype with Microsoft’s new MVC platform. It’s really just another project type in Visual Studio 2008, but it changes the way you write asp.net applications. So far I like it, but I’m still on the honeymoon. I have not really tried to do anything complex yet, and because it’s new to me, the simple things are still hard. Scott Guthrie’s posts posts have been helpful, as well as reading a pre-release of Manning’s upcoming book ASP.NET MVC In Action by Jeffrey Palermo, Ben Scheirman and Jimmy Bogard.
(more…)
Can hardly contain my excitement. I was just cleaning up a business object to post in my MVC article and of course was using JetBrain’s Resharper 4.1. Not sure if any of you remember, but when I started learning ASP.NET I developed some nice business objects to use with my MSDN articles. One of the nice tricks used is using anonymous delegates to sort lists. The code was a little tricky, but id did the job. Here is the old code:
[DataObjectMethod(DataObjectMethodType.Select, true)]
public List<BusinessObjectItem> GetMembers()
{
listBusinessObject.Sort(
new Comparison<BusinessObjectItem>(
delegate(BusinessObjectItem lhs, BusinessObjectItem rhs)
{ return lhs.Name.CompareTo(rhs.Name); }));
return listBusinessObject;
}
(more…)
Recently, we’ve moved our hosting for the Silicon Valley Code Camp to MOSSO, which is a hosted web farm. In order to run modules and handlers, it seems it’s necessary to run in IIS7’s integrated mode. Once this is set, other small issues creep up like for example you can no longer run HttpHandler’s from the standard HttpHandler’s section in your web.config file (see below)
<httpHandlers>
<remove verb="*" path="*.asmx"/>
<add verb="*" path="*.asmx" validate="false" ...
<add verb="*" path="*_AppService.axd" validate="false" ...
<add verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler,..
<add type="PeterKellner.Utils.CaptchaTypeHandler" verb="GET" path="CaptchaType.ashx"/>
</httpHandlers>
(more…)