vendredi 26 septembre 2014

ASP.NET MVC Best Pratices

"ASP.NET MVC is now getting popular more and more day by day, before dealing with this technology we need to understand some Do's and Dont's of it, may be can call it as Best Practices for ASP.NET MVC.
This curah will help you to understand Do's and Dont's of ASP.NET MVC. Lets start with it"...

http://curah.microsoft.com/198908/aspnet-mvc-dos-and-donts-best-practices

vendredi 2 mai 2014

ASP.NET Identity 2.0: Setting Up Account Validation and Two-Factor Authorization

With the release of the Identity 2.0 framework in March of 2014, the Identity team has added a significant set of new features to the previously simple, but somewhat minimal ASP.NET Identity system. Some of the most visible, and in-demand features introduced with the new release are account validation and two-factor authorization.
The Identity team has created a terrific sample project/template which can effectively serve as the starting point for just about any ASP.NET MVC project you wish to build out with Identity 2.0 features. In this post, we will look at implementing email account validation as part of the account creation process, and two-factor authorization.

Based On : http://typecastexception.com/post/2014/04/20/ASPNET-Identity-20-Setting-Up-Account-Validation-and-Two-Factor-Authorization.aspx

vendredi 21 septembre 2012

Reasons to avoid debug="true" in production

  • Timeouts – Have you ever noticed that you can spend an indefinite amount of time fooling around in the debugger without a halted request timing out? That’s because debug=”true” disables timeouts entirely, which is never a good idea on a live site.
  • Bundling and MinificationASP.NET’s new web optimization feature can automatically bundle and minify your JavaScript and CSS, but it only does so in release mode. When you run with debug=”true”, bundles are served as separate, unminified, uncombined script references with short caching headers. That’s important during development so you can read/debug your JavaScript code, but it defeats the entire point of the optimization exercise in production.
  • WebResource.axd caching – Speaking of client-side resource optimization, resources served through WebResource.axd include aggressive caching headers in release mode. In debug mode, they are not cached at all.

A harsh reminder about the importance of debug=”false”

http://encosia.com/a-harsh-reminder-about-the-importance-of-debug-false/

 

Don’t run production ASP.NET Applications with debug=”true” enabled

1) The compilation of ASP.NET pages takes longer (since some batch optimizations are disabled)

2) Code can execute slower (since some additional debug paths are enabled)

3) Much more memory is used within the application at runtime

4) Scripts and images downloaded from the WebResources.axd handler are not cached

 

http://weblogs.asp.net/scottgu/archive/2006/04/11/Don_1920_t-run-production-ASP.NET-Applications-with-debug_3D001D20_true_1D20_-enabled.aspx

 

samedi 28 juillet 2012

New Blog MLA3.NET

See my french posts on my new blog at Mets-la au 3.Net

jeudi 29 mars 2012

Table Layouts vs. Div Layouts: From Hell to. Hell?

Over the last several years, developers have moved from table-based website structures to div-based structures. Hey, that’s great. But wait! Do developers know the reasons for moving to div-based structures, and do they know how to? Often it seems that people are moving away from table hell only to wind up in div hell.

This article covers common problems with layout structure in web design. The first part goes through what table and div hells are, including lots of examples. The next section shows how to write cleaner and more readable code. The final part looks at what features await in future. Please join us on this journey from hell to heaven.

Read more:  http://coding.smashingmagazine.com/2009/04/08/from-table-hell-to-div-hell/

 

vendredi 9 mars 2012

Introduction to the ASP.NET Web API

“I am a huge fan of Ajax. If you want to create a great experience for the users of your website – regardless of whether you are building an ASP.NET MVC or an ASP.NET Web Forms site — then you need to use Ajax. Otherwise, you are just being cruel to your customers.

We use Ajax extensively in several of the ASP.NET applications that my company, Superexpert.com, builds. We expose data from the server as JSON and use jQuery to retrieve and update that data from the browser.

One challenge, when building an ASP.NET website, is deciding on which technology to use to expose JSON data from the server. For example, how do you expose a list of products from the server as JSON so you can retrieve the list of products with jQuery? You have a number of options (too many options) including ASMX Web services, WCF Web Services, ASHX Generic Handlers, WCF Data Services, and MVC controller actions.

Fortunately, the world has just been simplified. With the release of ASP.NET 4 Beta, Microsoft has introduced a new technology for exposing JSON from the server named the ASP.NET Web API. You can use the ASP.NET Web API with both ASP.NET MVC and ASP.NET Web Forms applications.

The goal of this blog post is to provide you with a brief overview of the features of the new ASP.NET Web API. You learn how to use the ASP.NET Web API to retrieve, insert, update, and delete database records with jQuery. We also discuss how you can perform form validation when using the Web API and use OData when using the Web API.”

Read More : http://stephenwalther.com/blog/archive/2012/03/05/introduction-to-the-asp-net-web-api.aspx

 

jeudi 2 février 2012

The Hacker Way

Facebook CEO Mark Zuckerberg in a letter to potential shareholders:
"The Hacker Way is an approach to building that involves continuous improvement and iteration. Hackers believe that something can always be better, and that nothing is ever complete. They just have to go fix it--often in the face of people who say it's impossible or are content with the status quo. Hackers try to build the best services over the long term by quickly releasing and learning from smaller iterations rather than trying to get everything right all at once. To support this, we have built a testing framework that at any given time can try out thousands of versions of Facebook. We have the words "Done is better than perfect" painted on our walls to remind ourselves to always keep shipping. Hacking is also an inherently hands-on and active discipline. Instead of debating for days whether a new idea is possible or what the best way to build something is, hackers would rather just prototype something and see what works. There's a hacker mantra that you'll hear a lot around Facebook offices: "Code wins arguments." Hacker culture is also extremely open and meritocratic. Hackers believe that the best idea and implementation should always win--not the person who is best at lobbying for an idea or the person who manages the most people."

vendredi 20 janvier 2012

Getting Started with Mobile Web Development Using HTML5, jQuery Mobile and ASP.NET MVC 4

« Welcome to the first installment of the Web Development Report, a new online column at MSDN Magazine. Each month, current topics and issues in Web application development using technologies such as HTML5, ASP.NET, jQuery, Mobile Web and more will be discussed. The area covered this month is mobile Web Development.

As you probably know, software development is shifting toward the mobile space. Mobile devices have become ubiquitous in the consumer landscape, and the demand for mobile software is increasing. Businesses want to carve their niche in the mobile marketplace with native mobile applications and mobile Web sites – the two types of applications available for mobile devices.

Creating native applications with native code means developing separate software that targets each platform of interest (e.g., one XAML app for Windows Phone 7 and one Objective-C app for iOS). Maintaining and supporting multiple code bases is challenging, in part because most software developer teams don’t have the resources to do so, especially across a large number of customers. Independent contractors often have to focus on only one or two platforms, limiting their prospects.

By creating mobile Web applications that take advantage of HTML5, jQuery Mobile and ASP.NET MVC 4, you can effectively target multiple platforms with a single code base. Any browser, including mobile Web browsers, can render the HTML pages created with these technologies. You’ll still need to consider dealing with different browsers, but overall, Web applications are much easier to develop and maintain than multiple native applications in different languages.»

 

Read More : http://msdn.microsoft.com/en-us/magazine/hh771055.aspx

 

jeudi 19 janvier 2012

10 Things ASP.NET Developers Should Know About Web.config Inheritance and Overrides

« The ASP.NET configuration system is build around the idea of inheritance:

Each Web.config file applies configuration settings to the directory that it is in and to all of the child directories below it. Settings in child directories can optionally override or modify settings that are specified in parent directories. Configuration settings in a Web.config file can optionally be applied to individual files or subdirectories by specifying a path in a location element.

The root of the ASP.NET configuration hierarchy is the systemroot\Microsoft.NET\Framework\versionNumber\CONFIG\Web.config file, which includes settings that apply to all ASP.NET applications that run a specific version of the .NET Framework. Because each ASP.NET application inherits default configuration settings from the root Web.config file, you need to create Web.config files only for settings that override the default settings.

For a lot of sites, you don't really need to know about that - you can get by with one Web.config file for the site. But, knowing how the inheritance works - and how to control it - can really help out.

I've noticed that a lot of the questions I answer questions on forums, StackOverflow, and internal e-mail lists can be solved by better understanding how ASP.NET configuration inheritance and overrides work. And so, a bunch of tips about how ASP.NET configuration inheritance and overrides work! I'll start with some basics, but there are some towards the end I'll bet most ASP.NET developers don't know. »

Read More on : http://weblogs.asp.net/jgalloway/archive/2012/01/17/10-things-asp-net-developers-should-know-about-web-config-inheritance-and-overrides.aspx#.TxdFHJ-5aNU.delicious

 

vendredi 18 novembre 2011

Announcing jQuery Mobile 1.0

Getting Started with jQuery Mobile

« jQuery Mobile provides a set of touch-friendly UI widgets and an AJAX-powered navigation system to support animated page transitions. Building your first jQuery Mobile page is easy, here's how. »

 

 

Read More : http://jquerymobile.com/blog/2011/11/16/announcing-jquery-mobile-1-0/

 

mardi 11 octobre 2011

About google DART : Structured web programming

Yesterday Google officially lunch this new web programming language : DART.

 

Read More : http://www.dartlang.org/

 

 

lundi 3 octobre 2011

Massive (The Micro-ORM)

« I've been using nHibernate for quite a few years now and have been having plenty of success with it. But sometimes it's just to much. So today I had a little project I had to do and I decided I would take Massive from Rob Connery a spin.”

 

Read More : http://blogs.lessthandot.com/index.php/DesktopDev/MSTech/massive-the-micro-orm-winforms

 

mardi 27 septembre 2011

C# Optimization Secrets

« You want to see ways you can add performance optimizations to your C# programs, focusing on the level of the code statements and methods. While high-level considerations, and factors external to your C# code are often most important, such as computer processor and network speed, there are many low-level performance optimizations you can do inside the C# language that can sometimes improve performance. This article, then, describes these optimizations. »

 

Read More : http://www.dotnetperls.com/optimization

 

mercredi 21 septembre 2011

Figuring out the IIS Version for a given OS in .NET Code

« Here's an odd requirement: I need to figure out what version of IIS is available on a given machine in order to take specific configuration actions when installing an IIS based application. I build several configuration tools for application configuration and installation and depending on which version of IIS is available on IIS different configuration paths are taken. For example, when dealing with XP machine you can't set up an Application Pool for an application because XP (IIS 5.1) didn't support Application pools. Configuring 32 and 64 bit settings are easy in IIS 7 but this didn't work in prior versions and so on. »

 

Read More :  http://www.west-wind.com/weblog/posts/2011/Sep/18/Figuring-out-the-IIS-Version-for-a-given-OS-in-NET-Code

 

mardi 13 septembre 2011

ASP.NET page methods are only as secure as you make them

One of the most persistent misconceptions about ASP.NET’s page methods is the notion that they have some intrinsic protection against requests that don’t originate from the page where they’re defined. Since a page method’s code resides within a page’s code-behind file, it’s intuitive to assume that those methods benefit from some form of inherent security.

 

Read More :  http://encosia.com/asp-net-page-methods-are-only-as-secure-as-you-make-them/

 

mardi 6 septembre 2011

ASP.NET vNext (VisualStudio and ASP.NET new release features)

“Over the next few months I’m going to be doing a series of posts that talk about some of the cool new features coming with the next releases of ASP.NET and Visual Studio (which we will start talking about more in the months ahead).  They contain a ton of new functionality and improvements – for both Web Forms and MVC - that I think you’ll really like, and which make building applications easier, faster and better.”

 

Read More : http://weblogs.asp.net/scottgu/archive/2011/08/31/asp-net-vnext-series.aspx

 

vendredi 2 septembre 2011

Full Screen Web Apps

“One of the first problems encountered when building a mobile web app from scratch is the amount of space consumed by the browser’s address bar. This tutorial will demonstrate how to reclaim the screen real estate otherwise lost to the address bar while accounting for orientation changes, content height problems, and internal document links.”

 

Read More : http://mobile.tutsplus.com/tutorials/mobile-web-apps/remove-address-bar/

 

mercredi 31 août 2011

Validate uploaded image content in ASP.NET

“A very few day ago i had to face the situation where hacker uploaded the malicious ASP script to the web server by changing its extension to .JPG through user interface which allow user to upload image file. Although developer team had put the validation on extension. But unfortunately extension of ASP script was .JPG and hence it is allowed extension. So hacker could upload that malicious script.

After this situation i thought just checking only extension for uploaded file is not the sufficient. We need to check content as well of the uploaded file.”

 

Read More : http://www.dotnetexpertguide.com/2011/05/validate-uploaded-image-content-in.html

 

mardi 30 août 2011

Web Deployment: Web.Config Transformation

“Usually web applications go through a chain of server deployments before being finally being deployed to production environment. Some of these environments can be Developer box (Debug), QA Server, Staging/Pre-Production, Production (Release). While transitioning between these environments various settings of the web application residing in web.config file change, some of these settings can be items like application settings, connection strings, debug flags, web services end points etc.

VS10’s new web.config transformation model allows you to modify your web.config file in an automated fashion during deployment of your applications to various server environments. To help command line based deployments, Web.Config transformation is implemented as an MSBuild task behind the scene hence you can simply call it even outside of deployment realm.”

Read More : http://blogs.msdn.com/b/webdevtools/archive/2009/05/04/web-deployment-web-config-transformation.aspx

 

vendredi 26 août 2011

How to allow user to input html in ASP.NET MVC

“Whenever we submit HTML or JavaScript as input in ASP.NET MVC application we get an exception like "A potentially dangerous Request.Form value was detected from the client (……)”. Because ASP.NET MVC has built-in request validation that helps you automatically protect against cross-site scripting (XSS) attacks and HTML injection attacks, it will prevent the user from posting HTML or JavaScript as input”…

http://dailydotnettips.com/2011/08/24/how-to-allow-user-to-input-html-in-asp-net-mvc/

[ValidateInput(false)] attribute disables request validation on complete model or view model

...

We can [AllowHtml] attribute on properties in model or view model to disable request validation.