Monday, April 26th, 2010
In this article we will be looking at a different type of architecture. One in which we utilize jQuery’s ability to easily transfer data (via Ajax and JSON) from the client to the server. We then use ASP.NET and LINQ to SQL to query the database and return a collection of data which gets (automatically) serialized to JSON and sent to the client. The benefits of combining these technologies include: more responsive applications, more processing on the client, less processing on the server and reduced network traffic. Everything runs faster and uses fewer resources.
Still not convinced? Here are some additional benefits of this architecture:
Benefits of the Architecture
- Unlike an ASP.NET UpdatePanel we only pass what we need; we only receive what we need. We don’t pass ViewStates, in fact we don’t even have a ViewState. We also don’t pass entire HTML chunks and receive HTML chunks we don’t use. For more on this; read: Why ASP.NET AJAX UpdatePanels are dangerous.
- By using jQuery to call the web service directly, we’ve eliminated over 100 KB of JavaScript and three extra HTTP requests that’s included when you use ASP.NET Ajax.
- Less dependencies – because all our code is simply xHTML we could switch to a PHP or a Java backend and none of our code for the UI would have to change. That’s right, there are no server-controls; that means no GridViews, no Repeaters, no ListViews, nothing that uses runat server will be found on the page. Not even a ScriptManager.
- Usability – We can create RIA interfaces AND maintain usability, giving us the best of both worlds.
- Cross-Browser friendly – We use nothing but xHTML code and jQuery which works across browsers.
- The entire presentation for the UI is done via CSS. Change the CSS and the entire UI can look different.
- We maintain a ‘Separation of Concerns‘ – this means we have 3 distinct and wholly separate code bases. A content or HTML level. A presentation or CSS level and a behavior or JavaScript level. We don’t have code mixed together in a web-page jambalaya.
- Switching architectures from Web Forms to MVC is a breeze.
Hopefully you are salivating at these benefits enough to decide to get your feet wet and follow along.
In this article will be leveraging these technologies to build a grid (or what looks like a table). Later on, in future articles, I will then show you how to implement sorting, paging and filtering on the grid. I have divided this article up into four sections: 1. Sever-side code (ASP.NET). 2. HTML 3. jQuery and lastly CSS.
(more…)
Posted in .NET, Ajax, C#, Website Design | 20 Comments »
Monday, June 4th, 2007
After reading Paul’s article “CSS The Star Matrix Pre-loaded“, I wanted to contribute by writing a back-end solution to the CSS effect.
Before we get into this, you will need to have PHP 5 installed and MySQL 3.23 or higher. PHP 5 allows for greater implementation of OOP (Object Oriented Programming) than its predecessors.
(more…)
Posted in Ajax, CSS, PHP | 37 Comments »
Wednesday, January 24th, 2007
And now, ladies and gentlemen introducing the hardest working man in code business, the one, the only Vinnie Garcia.
It’s with great pleasure that I introduce Vinnie to the Search-This team. Sure, I had to put a gun to his head, but that’s the Italian way of doing things.
You may work hard, but no one works harder than Vinnie Garcia. The man is approaching the 20,000 post mark over at the SitePoint forums! And it shows, there’s not too many areas in the web world that Vinnie hasn’t at least dabbled in. So when Vinnie speaks, you’re gonna wanna listen.
Enjoy Vinnie’s bio below:
User Name: vinnie
- childhood ambition: becoming a cartoonist
- fondest memory: not sure
- favorite music: anything with a good beat; mostly rock, electronic, and hip-hop
- retreat: the beach or my headphones
- proudest moment: getting married
- biggest challenge: being married
- alarm clock: don’t use one, I tend to wake up early anyway
- perfect day: sitting by the pool doing nothing at all
- first job: warehouse assistant for a medical supply company
- indulgence: kickball
- favorite movie: lots of them, most recently: Borat
- inspiration: art, nature, architecture, and most importantly loved ones
Posted in Ajax, Blogging, Website Design | 1 Comment »
Friday, January 12th, 2007
Long time users of Search-This will no doubt know cpradio. Matt pretty much grew up on Search-This. When he was just a young lad in high school he was administering the forums and helping people with all their web related needs.
Matt’s passion has always been as a coder. Now that Matt has graduated college and become a full time software engineer there’s not many languages he hasn’t worked with.
Look for Matt’s, or rather cpradio’s first article this Monday titled: “OOP in PHP from a .NET OOP Perspective” – should be a good read.
I can’t really welcome cpradio as a new member to the team, because he has always been part of the team. So just enjoy his bio below.
User Name: cpradio
- childhood ambition: to be a software developer, seriously, it was…
- fondest memory: looking at my old code and just realizing what an idiot I was back then
- favorite music: anything but elevator music, seriously, how do you not fall asleep to elevator music?
- retreat: hiking in the smokies
- proudest moment: three weeks of hammering an application, countless thankful users
- biggest challenge: writing quote engines for an insurance company and making it easy to maintain
- alarm clock: 6:30 AM on a good day, 4:30 AM on implementation day (project going to production)
- perfect day: my wife told me it was her wedding day, err… our wedding day.
- first job: PetsMart stocker/fork-lift driver
- indulgence: hard drives, I have 10 (in one PC) equaling 1.8 TB but that is not enough
- favorite movie: geez, I can’t just pick one, that would be unfair to the rest of them
- inspiration: knowing knowledge has no limits other than a person’s refusal to continue learning
Posted in .NET, Ajax, C#, PHP | 4 Comments »