background preloader

Development Concepts

Facebook Twitter

Configure reverse proxy with URL Rewrite and ARR for IIS | wrapcode. Finally, feel good to be back with one more article. I’m writing about just another “developer life challenge” I faced few weeks back. We got stuck in a situation where we wanted to test our web application in IE8 and IE9. Basically I wanted to make it compatible with both the browsers. Yeah I know, being a modern web technology fan, you’ll hate me for this but it was a need since most of the legacy non technical users are still stuck on those browsers.

Good bye old browsers, we will (not) miss you! Well, our web application was still in development stage. In production stage both the API and web app were supposed to be on single domain and bound to single port so we didn’t have to worry about production. (Drawn with Prepare the base This article is written with the consideration that you are configuring reverse proxy for IIS. Download and Install Url Rewrite module – Head over to this link : DownloadDownload and install ARR (Application request routing) module : Download. Deployments Best Practices  •  Beanstalk Guides. Introduction This guide is aimed to help you better understand how to better deal with deployments in your development workflow and provide some best practices for deployments.

Sometimes a bad production deployment can ruin all the effort you invested in a development process. Having a solid deployment workflow can become one of the greatest advantages of your team. Before you start, I recommend reading our Developing and Deploying with Branches guide first to get a general idea of how branches should be setup in your repository to be able to fully utilize tips from this guide. It’s a great read. Note on Development Branch In this guide you will see a lot of references to a branch called development.

Web Development Disclaimer Our team makes web applications exclusively (Beanstalk and Postmark), so we don’t have much experience when it comes to deploying something that’s not based in the internet. The Workflow Developers work on bugs and features in separate branches. Development Environment. An introduction to version control  •  Beanstalk Guides. If you are interested in version control, but have not made the jump yet, the most common reason we’ve heard is how confusing it seems. The best place to start if you are new to version control are the basic concepts. Why is version control important? If you are reading this, it’s possible that you are updating documents that look something like this: index-v12-old2.html. Let’s get away from this and on to something that will not only allow you to control your source code and files, but become more productive as a team.

If this sounds familiar: Communicated with your team via email about updates. Made updates directly on your production server. You can now look forward to this instead: File names and directory structures that are consistent for all team members. The basic concepts Tracking changes A version control system is mostly based around one concept, tracking changes that happen within directories or files. As you make changes, it will track each change behind the scenes. Committing. Version control without the command line  •  Beanstalk Guides. The command line is a powerful way to use version control systems, but not everyone is as comfortable with memorizing and using text commands.

Thankfully, there are many good GUI clients available for popular version control and operating systems. We’ve compiled a list of our favorites below, which all work well with Beanstalk. Subversion Clients Subversion is a popular choice for people who are new to version control because of it’s robust ecosystem of clients. Cornerstone (Mac, $59) Cornerstone is our favorite Subversion client for the Mac. Cornerstone is also integrated with Beanstalk, making it easier to add your repositories. Versions (Mac, $59) Versions is another very powerful client for Mac. See also: svnX is an open source and free OS X client with the most basic features. TortoiseSVN (Windows, Free) TortoiseSVN is free, very powerful and popular Subversion client for Windows.

RabbitVCS (Linux, Free) SmartSVN (Multi-platform, $69) IDE Integration with Subversion PixelNovel ($100) Working with ASP.NET Master Pages Programmatically. The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location. You can perform a number of common tasks programmatically with master pages, including the following: Accessing members that are defined on the master page, which can consist of public properties and methods or controls.Attaching master pages to a content page dynamically.

A Visual Studio project with source code is available to accompany this topic: Download. When you use a @ MasterType directive, such as the one in the example, you can reference members on the master page as in the following example: CompanyName.Text = Master.CompanyName; Getting the Values of Controls on the Master Page // Gets a reference to a TextBox control inside a ContentPlaceHolder ContentPlaceHolder mpContentPlaceHolder; TextBox mpTextBox; mpContentPlaceHolder = (ContentPlaceHolder)Master.FindControl("ContentPlaceHolder1"); if(mpContentPlaceHolder !

Where does ASP.NET Web API Fit? With the pending release of ASP.NET MVC 4 and the new ASP.NET Web API, there has been a lot of discussion of where the new Web API technology fits in the ASP.NET Web stack. There are a lot of choices to build HTTP based applications available now on the stack - we've come a long way from when WebForms and Http Handlers/Modules where the only real options.

Today we have WebForms, MVC, ASP.NET Web Pages, ASP.NET AJAX, WCF REST and now Web API as well as the core ASP.NET runtime to choose to build HTTP content with. Web API definitely squarely addresses the 'API' aspect - building consumable services - rather than HTML content, but even to that end there are a lot of choices you have today. So where does Web API fit, and when doesn't it?

But before we get into that discussion, let's talk about what a Web API is and why we should care. What's a Web API? These mobile or rich Web applications use their HTTP connection to return data rather than HTML markup in the form of JSON or XML typically. Calling a Web API From a .NET Client (C# This tutorial shows how to call a web API from a .NET application, using HttpClient. In this tutorial, we will write an app that consumes the following web API.

To learn how to implement this API on the server, using ASP.NET Web API, see Creating a Web API that Supports CRUD Operations. For simplicity, the client application in this tutorial is a Windows console application. HttpClient is also supported for Windows Phone and Windows Store apps. For more information, see Writing Web API Client Code for Multiple Platforms Using Portable Libraries Create the Console Application Start Visual Studio and select New Project from the Start page. In the Templates pane, select Installed Templates and expand the Visual C# node. Install the Web API Client Libraries Use NuGet Package Manager to install the Web API Client Libraries package. From the Tools menu, select Library Package Manager, then select Package Manager Console. Install-Package Microsoft.AspNet.WebApi.Client Add the Model Class. Sending HTML Form Data: Form-urlencoded Data. Part 1: Form-urlencoded Data This article shows how to post form-urlencoded data to a Web API controller.

Download the completed project. Overview of HTML Forms HTML forms use either GET or POST to send data to the server. The method attribute of the form element gives the HTTP method: The default method is GET. Part 1 of this article looks at x-www-form-urlencoded format. Sending Complex Types Typically, you will send a complex type, composed of values taken from several form controls. Namespace FormEncode.Models{ using System; using System.ComponentModel.DataAnnotations; public class Update { [Required] [MaxLength(140)] public string Status { get; set; } public DateTime Date { get; set; } }} Here is a Web API controller that accepts an Update object via POST. This controller uses action-based routing, so the route template is "api/{controller}/{action}/{id}". Now let’s write an HTML form for users to submit a status update. Sending Form Data via AJAX Sending Simple Types =value. Walkthrough: Using ASP.NET Routing in a Web Forms Application.

The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location. This walkthrough shows how to modify an existing ASP.NET Web site to include ASP.NET routing features. At the end of this walkthrough the site will have three new Web pages. Hyperlinks in one of the new pages link to the other two pages by using routes. Because these hyperlinks use routing to create the link URLs, they do not need to be changed if the target pages change names or location. This walkthrough shows how you can do the following with a minimum amount of code: Define custom URL patterns that are not dependent on physical file names.Generate URLs based on route URL parameter values by using markup or code.

A Visual Studio Web site project with source code is available to accompany this topic: Download. In order to run this walkthrough, you must have the following: To add a method to the Global.asax file for adding routes. Introduction to Test Driven Development (TDD) Test-driven development (TDD) (Beck 2003; Astels 2003), is an evolutionary approach to development which combines test-first development where you write a test before you write just enough production code to fulfill that test and refactoring. What is the primary goal of TDD? One view is the goal of TDD is specification and not validation (Martin, Newkirk, and Kess 2003). In other words, it’s one way to think through your requirements or design before your write your functional code (implying that TDD is both an important agile requirements and agile design technique).

Another view is that TDD is a programming technique. As Ron Jeffries likes to say, the goal of TDD is to write clean code that works. I think that there is merit in both arguments, although I lean towards the specification view, but I leave it for you to decide. Table of Contents 1. Figure 1. I like to describe TDD with this simple formula: TDD = Refactoring + TFD. TDD completely turns traditional development around. 2.