Welcome to fuzzydev Sign in | Join | Help

Latest Posts

More Posts Next page »

External News

  • ASP.NET Upload Panel

    How to implement drag and drop file upload using HTML5 and ASP.NET Web Forms
    23 hours, 14 minutes ago by ASP.NET Articles of the Day
  • The Special Properties of ngRepeat In AngularJS

    Today’s tip comes straight from the AngularJS documentation, but I’ve seen a few people miss the topic. 

    Inside an ngRepeat directive the special properties $first, $last, and $middle are available. These properties hold boolean values ($first is true only for the first repeated element), and two more special properties that are available are $even and $odd.

    Another useful property is the $index property, which contains the offset of each repeated element and starts at 0 (like all good offsets).

    You can view the following markup live in this Plunker. The code is using $first and $last to avoid showing clickable up and down prompts when an item is in the first or last position. The markup is also using $index to grab the offset of a clicked item.

        <tr ng-repeat="item in items">
            <td><span ng-show="!$first" ng-click="moveUp($index)">up</span></td>
            <td><span ng-show="!$last" ng-click="moveDown($index)">down</span></td>

    Combined with the following controller, you can move items up and down by clicking on the arrows.

    module.controller("mainController", function($scope){
        $scope.items = [
            { title: "Item 1" },
            { title: "Item 2" },
            { title: "Item 3" },
            { title: "Item 4" },
            { title: "Item 5" },
        var move = function (origin, destination) {
            var temp = $scope.items[destination];
            $scope.items[destination] = $scope.items[origin];
            $scope.items[origin] = temp;
        $scope.moveUp = function(index){            
            move(index, index - 1);
        $scope.moveDown = function(index){                    
            move(index, index + 1);
    17 Apr 2014, 12:12 PM by OdeToCode by K. Scott Allen
  • Default Model Binding and Explicit Model Binding in MVC

    This post covers Default Model Binding and Explicit Model Binding in MVC, using code snippets.
    17 Apr 2014, 3:00 AM by ASP.NET Articles of the Day
  • Exploring ASP.NET Web Pages - A fully-featured MiniBlog using just Razor

    ASP.NET "Razor" Web Pages are ASP.NET sites without models, views, and controllers, without project files. Some folks say "oh, that's just Classic ASP, or PHP right? Not at all. It's the fill power and speed of the .NET CLR, the full syntax of C#, LINQ, along with things like C# dynamics. It's super powerful, and my friend Mads and I are surprised more people don't use them for small things. In fact, Rob Conery and I did the http://thisdeveloperslife.com web site using just Razor and Rob's "massive" micro-ORM . Later I made http://hanselminutes.com with Web Pages as well. This blog runs DasBlog , an older ASP.NET 2.0 blogging engine I worked on with Clemens Vasters and a lot of co-contributors, but...(read more)
    16 Apr 2014, 9:07 AM by Scott Hanselman - ASP.NET
  • MVC with Ajax - Push Start For Beginners

    This is quick tutorial on how to start with AJAX in MVC with basic operations such as Add, Update, Edit and Delete in a single page.
    16 Apr 2014, 3:00 AM by ASP.NET Articles of the Day
  • Deconstructing A Function From Microsoft Word 1.1a

    When Microsoft released the source code to MS-DOS and Word, I had to take a look. One of the first functions I came across was ReplacePropsCa from the srchfmt.c file.

    /* %%Function:ReplacePropsCa %%Owner:rosiep */
    ReplacePropsCa(prpp, pca)
    struct RPP *prpp;
    struct CA *pca;
        struct CA caInval;
        if (prpp->cbgrpprlChp)
            ExpandCaSprm(pca, &caInval, prpp->grpprlChp);
            ApplyGrpprlCa(prpp->grpprlChp, prpp->cbgrpprlChp, pca);
            if (!vfNoInval)
                InvalText(pca, fFalse /* fEdit */);
        if (prpp->cbgrpprlPap)
            int fStc;
            struct CHP chp;
            struct PAP pap;
            if (fStc = (*prpp->grpprlPap == sprmPStc))
                CachePara(pca->doc, pca->cpFirst);
                pap = vpapFetch;
            ExpandCaSprm(pca, &caInval, prpp->grpprlPap);
            ApplyGrpprlCa(prpp->grpprlPap, prpp->cbgrpprlPap, pca);
            if (fStc)
                GetMajorityChp(pca, &chp);
                EmitSprmCMajCa(pca, &chp);
                if (!FMatchAbs(pca->doc, &pap, &vpapFetch))
            if (!vfNoInval)
                InvalText (pca, fFalse /* fEdit */);

    Thought #1: Every Function Has An Owner. Although I see the occasional project where each file has a comment indicating the owner, I don’t remember ever seeing ownership declared on individual functions. I think the concept of collective ownership is a healthier approach to building software, both for the software and the developers. Today’s tools also make it easier to jump around in code.

    Thought #2: The Flow Control Is All Wrong. Oh, wait, the flow control seems ok, it’s just the funny indentation of curly braces setting off alarm bells. Joel Spolsky has a post from 2005 titled Making Wrong Code Look Wrong in which he says:

    This is the real art: making robust code by literally inventing conventions that make errors stand out on the screen.

    After many years in 3 different languages using { and }, my eyes are accustomed to looking for a closing curly brace in the same column as the if. Not seeing the curly means code might accidently execute outside the conditional check. This function hides the closing curly and is full of evil.

    Thought #3: The Notation Is Hilarious. Call it Hungarian Notation, or Anti-Hungarian Notation, or something not Hungarian at all but a custom DSL designed in C. In any case the idea of checking to see if a prpp->grpplPap is equal to a sprmPStc is just one brick in a wall of gibberish that reminds me of a Lewis Carroll poem.

    `Twas brillig, and the slithy toves
      Did gyre and gimble in the wabe:
    All mimsy were the borogoves,
      And the mome raths outgrabe.

    Both the function and the poem include gibberish, but at least the Lewis Carroll poem rhymes.

    15 Apr 2014, 12:12 PM by OdeToCode by K. Scott Allen
  • Questions Developers Ask When Moving From ASP.NET Web Forms to MVC

    Some common questions that arise when seasoned Web Forms developers tread in ASP.NET MVC for the first time. It’s not an ASP.NET MVC vs. Web Forms article, but rather focuses on what’s different and how.
    15 Apr 2014, 3:00 AM by ASP.NET Articles of the Day
  • Azure Updates: Web Sites, VMs, Mobile Services, Notification Hubs, Storage, VNets, Scheduler, AutoScale and More

    It has been a really busy last 10 days for the Azure team. This blog post quickly recaps a few of the significant enhancements we’ve made.  These include: Web Sites : SSL included, Traffic Manager, Java Support, Basic Tier Virtual Machines : Support for Chef and Puppet extensions, Basic Pricing tier for Compute Instances Virtual Network : General Availability of DynamicRouting VPN Gateways and Point-to-Site VPN Mobile Services : Preview of Visual Studio support for .NET, Azure Active Directory integration and Offline support; Notification Hubs : Support for Kindle Fire devices and Visual Studio Server Explorer integration Autoscale : General Availability release Storage : General Availability release of Read Access Geo Redundant Storage...(read more)
    14 Apr 2014, 11:58 PM by ScottGu's Blog
  • Deep Linking a Tabbed UI With AngularJS

    The idea is to dynamically generate a tabbed navigation using Angular and UI Bootstrap.

     I’ve done this before, but this time around I needed the ability to deep link into a tab. That is, if a user bookmarks /someapp/tab2, then the 2nd tab should be active with its content showing.

    Tabbed UI Angular JS

    Instead of using ngRouter, which is a bit simplistic, I decided to use UI Router. UI Router is not without quirks and bugs, but it does give the opportunity to setup multiple, named “states” for an application, and can manage nested states and routes through associated URLs. One of the first steps in working with UI Router is configuring the known states

    var app = angular.module("routedTabs", ["ui.router", "ui.bootstrap"]);
    app.config(function($stateProvider, $urlRouterProvider){
            .state("main", { abtract: true, url:"/main", templateUrl:"main.html" })
                .state("main.tab1", { url: "/tab1", templateUrl: "tab1.html" })
                .state("main.tab2", { url: "/tab2", templateUrl: "tab2.html" })
                .state("main.tab3", { url: "/tab3", templateUrl: "tab3.html" });

    In the above code, “main” is a parent state with three children (tab1, tab2, and tab3). Each child has an associated URL (which will be appended to the parent URL) and a template. Each child template will plug into the parent template of main.html, which itself has to plug into the application shell.

    In other words, the shell of the application uses the ui-view directive to position the parent template (main.html).

    <body ng-app="routedTabs" class="container">
       <div ui-view></div>

    This is not much different than using ngRouter and its ngView directive, but UI router also allows for main.html to use another ui-view directive where one of the child templates will appear.

    <div ng-controller="mainController">
                ng-repeat="t in tabs" 
        <div ui-view></div>

    This view requires a controller to provide the tab data.

    app.controller("mainController", function($rootScope, $scope, $state) {        
        $scope.tabs = [
            { heading: "Tab 1", route:"main.tab1", active:false },
            { heading: "Tab 2", route:"main.tab2", active:false },
            { heading: "Tab 3", route:"main.tab3", active:false },
        $scope.go = function(route){
        $scope.active = function(route){
            return $state.is(route);
        $scope.$on("$stateChangeSuccess", function() {
            $scope.tabs.forEach(function(tab) {
                tab.active = $scope.active(tab.route);

    The only reason to listen for UI router’s $stateChangeSuccess is to keep the right tab highlighted if the URL changes. It’s a bit of a hack and actually makes me wonder if using tabs from UI Bootstrap is worth the extra code, or if it would be easier to write something custom and integrate directly with UI router.

    If you want to try the code for yourself, here it is on Plunkr

    14 Apr 2014, 12:12 PM by OdeToCode by K. Scott Allen
  • Code in the Cloud Using Visual Studio Online

    Rachel Appel provides an overview of Visual Studio Online (codename Monaco), the newest Microsoft developer editor product.
    14 Apr 2014, 3:00 AM by ASP.NET Articles of the Day
  • Base64 Encode Image in Website - Web Essential

    Learn about Base64 encoded images and how they can improve website performance. The article makes use of Web Essentials which is a must have Visual Studio extension.
    13 Apr 2014, 3:00 AM by ASP.NET Articles of the Day
  • Custom Authentication and Authorization in ASP.NET MVC

    When standard types of authentication do not meet your requirements, you need to modify an authentication mechanism to create a custom solution. A user context has principal which represents the identity and roles for that user. A user is authenticated by its identity and assigned roles to a user determine about authorization or permission to access resources.
    12 Apr 2014, 3:00 AM by ASP.NET Articles of the Day
  • Adding Two-Factor authentication to an ASP.NET application

    ASP.NET Identity 2.0 was released last month and it's got a number of significant updates and new features that are worth checking out. For historical context, read the " Introduction to ASP.NET Identity " article that includes a lot of background and information on why certain decisions were made, as well as an  overview of some of the goals of ASP.NET Identity 2.0 like: One Identity system for ASP.NET Web Forms, MVC, Web API, and Web Pages Total control over user profile schema. Pluggable storage mechanisms from Windows Azure Storage Table Service to NoSQL databases Unit Testable Claims-based Auth adds more choice over simple role membership Social Logins (MSFT, FB, Google, Twitter, etc) Based on OWIN middleware, ASP.NET...(read more)
    08 Apr 2014, 10:14 AM by Scott Hanselman - ASP.NET
  • EF Code First Migrations Deployment to an Azure Cloud Service

    To deploy a Code First database to an Azure Web Site, you can use the Execute Code First Migrations check box in the Publish Web wizard: When you select that check box, Visual Studio configures the destination web site so that Entity Framework automatically deploys the database or updates it by running the MigrateDatabaseToLatestVersion initializer on application start, as explained in this VS web deployment tutorial . But if you’re deploying to an Azure cloud service you don’t get to use the Publish Web wizard. What then? In that case, you have two options:   Write code that executes migrations when the application starts. Write Web.config transforms to configure the MigrateDatabaseToLatestVersion initializer to run. Write App_Start...(read more)
    09 Apr 2014, 3:40 AM by .NET Web Development and Tools Blog
  • Push Notifications Using Notification Hub and .NET Backend (Link)

    Posted the blog Push Notifications Using Notification Hub and .NET Backend on the Azure Mobile Services Team Blog explaining how to leverage Azure Notification Hubs and Azure Mobile Services to push notifications to any mobile platform. Henrik Read More......(read more)
    09 Apr 2014, 7:08 AM by Henrik's Blog
  • More Posts Next page »
Copyright 2010, Sachin Joshi. All rights reserved.
The content on this site represents my own personal opinions and thoughts at the time of posting, and does not reflect those of my employer's in any way.
Powered by Community Server, by Telligent Systems