So you have seen the light and ready to make the jump into ASP.NET MVC. But wait! You are not ready to migrate a million lines of code from your legacy Web Forms application? No problem. You can easily integrate MVC 4 into your existing Web Forms application and gradually phase out the legacy stuff over time.

There are many articles and blog posts about this topic. However, most are outdated or take the loooong way. I have a simple, clean solution for you! Here it goes:

  1. Upgrade your Web Forms application to .NET 4 (and Visual Studio 2012 if ...
If you have used WCF RIA Services along with Entity Framework for Silverlight applications, you know how useful they are for performing database operations from your application.  With the WCF RIA Services Toolkit, it gives you even more flexibility to expose your RIA DomainService methods to not only a Silverlight application, but any application that can access a SOAP or JSON endpoint.
I will provide some steps here for setting up and consuming data through a SOAP endpoint.

1. Install WCF RIA Services Toolkit

You will need to install the toolkit in your development environment.  You can get it here...
JavaScript has been turning up everywhere. With nearly every desktop and mobile web browser on the planet coming equipped with a JavaScript engine, the language has become the de facto standard for client side code. There is just no better way to guarantee your audience can access the full feature set of your application.

Although JavaScript has typically been regarded as a client side technology, in-roads have been made in other areas in recent years. Frameworks like node.js are powering major server side applications and JavaScript can even be found querying some of the major NoSQL databases.

Here at Falafel ...
Sitefinity leaves a lot to be desired with the REST services. For example, take a look at the returned data from Sitefinity's news service out-of-the-box:

{
   "Context":[
      {
         "Key":"String content",
         "Value":"String content"
      }
   ],
   "IsGeneric":true,
   "Items":[
      {
         "Author":"String content",
         "AvailableLanguages":[
            "String content"
         ],
         "CommentsCount":2147483647,
         "DateCreated":"/Date(928164000000-0400)/",
         "DateModified":"/Date(928164000000-0400)/",
         "DefaultPageId":"1627aea5-8e0a-4371-9022-9b504344e724",
         "ExpirationDate":"/Date(928164000000-0400)/",
         "Id":"1627aea5-8e0a-4371-9022-9b504344e724",
         "IsDeletable":...

Ever since Sitefinity 4 was released, developers were coming up with new approaches to include JQuery libraries and plugins in their Sitefinity websites.  The unpleasant fact is that their JavaScript code did not work under all circumstances.

To make your plugins or libraries load in good order, your JavaScript code has to work when:

  • You are anonymously browsing the Sitefinity website.
  • You are editing your website in the back-end.
  • You are browsing the website in Edit mode.

Sitefinity makes heavy use of JQuery and other Javascript libraries in its own administrative UI. Sitefinity loads jQuery when you are working inside ...

The “Email Campaign” module of Sitefinity 4 is what you would use to create email campaigns, manage lists of subscribers, and test AB campaigns. If you haven’t used this module, you can get more information on the Sitefinity website by clicking this link:

http://www.sitefinity.com/40/help/developers-guide/sitefinity-essentials-modules-working-with-email-campaigns.html

While this is a very useful module in Sitefinity 4 out of the box, I’m going to show you how you could add some additional functionality to this module. For the purposes of this Blog, let’s assume you would like to be able to export your Mailing Lists to a csv file. The way we will ...

The mobile revolution has created a plethora of new platforms and languages. It is rare to see old technologies successfully reaching new grounds together. A good example of this is .NET MVC and jQuery Mobile. The blends of Razor, HTML, CSS, and jQuery make mobile a very familiar territory, a package that makes things quick, easy, and beautiful!

Setup the Project

The first thing you want to do is fire up Visual Studio and create a new MVC 3 Internet Application. This will give you membership, templates, and sample content to your website with a single click. Our goal from here is to extend it ...

Even though I’ve been doing ASP.NET for 8 years, I never realized until today that when you put a breakpoint in Application_Start in Global.asax, it may never be hit.  The reason, I discovered, is that the debugger doesn’t have time to attach to the web application before Application_Start finishes.  To get around this, you can force your application to restart after the debugger has had a chance to attach by simply editing and saving a change the web.config.  This causes the application to restart and your breakpoints in Application_Start will now be hit.

The task at hand is more complicated than it sounds. Normally you would just generate a button in Paypal and paste the form code to your website. If it were only that easy. Try doing this in any ASP.NET website and you will run into a big problem... no nested forms allowed!

The issue here is that ASP.NET websites are wrapped in a single form by architectural design. This is what the folks at Microsoft came up with when dreaming of ASP.NET. This sounds like a good idea - wrap the website in a form so EVERYTHING gets posted back... ...

Few things are more disappointing to an ASP.NET programmer than this one line of code in a web.config:

<sessionState mode="Off" />

You probably know what I mean if you’ve ever been asked to implement user sessions for a web site that has ASP.NET’s built-in session state disabled.  In this post I will offer one simple alternative that allows you to implement user sessions on just such a web site.

Cookies Taste Better In-Memory

The secret to my solution is HTTP cookies.  In my experience, programmers are increasingly afraid to create sites that require cookies because ...

Falafel Software is very excited to announce the addition of Basem Emara, widely acclaimed Sitefinity Guru, to the team!
Basem brings with him not only a well-known name and a unique track record in the Sitefinity community and consulting business, but also a very successful set of commercially available Sitefinity modules. Falafel Software is pleased to announce that these modules are now Falafel Software modules, available on the Telerik Marketplace and the Falafel store.
“With this acquisition, Falafel is firmly positioning itself as the leading Sitefinity vendor for consulting, training and off the shelf modules.” said Lino Tadros, ...

Creating innovative software is a lot of fun. Usually this is the equation for coming up with some pretty useful plugins, modules, and applications. Sometimes they are so useful that I distribute them to communities to use for their own projects. This way, I feel as if I am contributing to the evolution of technology and even humanity :)

There are some tedious tasks involved when doing this that slow down my development, which is not so fun. If you develop solutions targeted for multiple versions of a software, you will be sure to get this error back from the ...

Remember when we used to code in notepad? Those days are long, long gone. Now we have intellisense, syntax highlighter, code completion, linked navigation, drag-and-srop, code repositories, live debuggers... it can make your head spin. Though somehow, order comes out of chaos and perfect harmony is achieved with hundreds of thousands of lines of code shared worldwide with millions of coders. Quite a matrix we have developed!

I actually started coding in ASP.NET using notepad. I just could not trust the IDE's, especially Visual Studio, because they made so many assumptions and worked too much without me knowing. I felt ...

I came across an interesting behavior today. I was dynamically loading a user control into a RadTooltip using Page.LoadControl("MyUsercontrol.ascx")

Canceling the tooltip causes a partial-page postback. If I then reopen the tooltip before I do something to cause a full-page postback, the user control in the tooltip loads with the cached control state from the canceled instance. It appears that the second call to Page.LoadControl() returns an object with the same ID, and ASP.NET automatically wired it up.

My solution: in an event handler for the user control's Cancel button, I change the user control's ID to some throwaway text, like ...

I've been working on a multilanguage web site using ASP.NET localization. I wanted to return unique meta tags for each page in the user's language. There are a handful of ways to accomplish this (MasterPage codebehind, base page codebehind, etc); here's the approach I took:

  1. My web site was already taking advantage of Web.Sitemap, so I decided it would be best to store the meta tags there as a custom attribute. Web.Sitemap's resources can be globalized, so I actually don't need to do anything special to the sitemap besides set enableLocalization="true" and assign a unique resourceKey attribute if one does ...
If you're like me, you sometimes use AJAX controls in your web page. And, if you're like me, you find that when they fail to behave as expected, you as the user are not notified as to the reason. Instead, the page will just stare back at you blankly: no spinning globe, no twirling fox to indicate that it is processing your request. Of course, what's really happened is that your AJAX request caused an unhandled exception on the server and the request was canceled. If you're like me (and if you've read this far I am forced to conclude ...