European ASP.NET MVC Hosting

BLOG about Latest ASP.NET MVC Hosting and Its Technology - Dedicated to European Windows Hosting Customer

European World-Class Windows and ASP.NET Web Hosting Leader - HostForLIFE.eu

clock December 18, 2012 07:11 by author Scott

Fantastic and Excellent Support has made HostForLife.eu the Windows and ASP.NET Hosting service leader in European region. HostForLife.eu delivers enterprise-level hosting services to businesses of all sizes and kinds in European region and around the world. HostForLife.eu started its business in 2006 and since then, they have grown to serve more than 10,000 customers in European region. HostForLife.eu integrates the industry's best technologies for each customer's specific need and delivers it as a service via the company's commitment to excellent support. HostForLife.eu core products include Shared Hosting, Reseller Hosting, Cloud Computing Service, SharePoint Hosting and Dedicated Server hosting.

HostForLife.eu service is No #1 Top Recommended Windows and ASP.NET Hosting Service in European continent. Their services is ranked the highest top #1 spot in several European countries, such as: Germany, Italy, Netherlands, France, Belgium, United Kingdom, Sweden, Finland, Switzerland and many top European countries. For more information, please refer to http://www.microsoft.com/web/hosting/HostingProvider/Details/953.

HostForLife.eu has a very strong commitment to introduce their Windows and ASP.NET hosting service to the worldwide market. HostForLife.eu starts to target market in United States, Middle East and Asia/Australia in 2010 and by the end of 2013, HostForLife.eu will be the one-stop Windows and ASP.NET Hosting Solution for every ASP.NET enthusiast and developer.

HostForLife.eu leverages the best-in-class connectivity and technology to innovate industry-leading, fully automated solutions that empower enterprises with complete access, control, security, and scalability. With this insightful strategy and our peerless technical execution, HostForLife.eu has created the truly virtual data center—and made traditional hosting and managed/unmanaged services obsolete.

HostForLIFE.eu currently operates data center located in Amsterdam (Netherlands), offering complete redundancy in power, HVAC, fire suppression, network connectivity, and security. With over 53,000 sq ft of raised floor between the two facilities, HostForLife has an offering to fit any need. The datacenter facility sits atop multiple power grids driven by TXU electric, with PowerWare UPS battery backup power and dual diesel generators onsite. Our HVAC systems are condenser units by Data Aire to provide redundancy in cooling coupled with nine managed backbone providers.

HostForLife.eu does operate a data center located in Washington D.C (United States) too and this data center is best fits to customers who are targeting US market. Starting on Jan 2013, HostForLife.eu will operate a new data centre facility located in Singapore (Asia).

With three data centers that are located in different region, HostForLife.eu commits to provide service to all the customers worldwide. They hope they can achieve the best Windows and ASP.NET Hosting Awards in the World by the end of 2013.

About HostForLIFE.eu

HostForLife.eu is Microsoft No #1 Recommended Windows and ASP.NET Hosting in European Continent. Their service is ranked the highest top #1 spot in several European countries, such as: Germany, Italy, Netherlands, France, Belgium, United Kingdom, Sweden, Finland, Switzerland and many top European countries.

Our number one goal is constant uptime. Our data center uses cutting edge technology, processes, and equipment. We have one of the best up time reputations in the industry.

Our second goal is providing excellent customer service. Our technical management structure is headed by professionals who have been in the industry since its inception. We have customers from around the globe, spread across every continent. We serve the hosting needs of the business and professional, government and nonprofit, entertainment and personal use market segments.



Premier European HostForLIFE.eu Officially Announces SharePoint 2013 Hosting in European Data Center

clock November 21, 2012 07:47 by author Scott

HostForLIFE.eu, the premier European Windows and ASP.NET provider proudly announces the immediate availability of Microsoft’s new SharePoint 2013 hosting. HostForLIFE.eu offers this new product at the amazing price, just only €9.99/month.

“SharePoint 2013 is really fantastic; it brings many exciting new features, like Microsoft App Store, SharePoint Designer 2013 support, the use of mobile smart devices. And what amazing here is you can find all this new functionality for only €9.99/month” Said Kevin Joseph, manager of HostForLIFE.eu. “These enhancements are fantastic and make the platform more user-friendly, scalable, modern, and powerful as a robust collaboration, social, and knowledge management platform for the enterprise.”

HostForLIFE.eu utilizes the newly-released Microsoft Windows Server 2012 and SQL Server 2012 as the foundation for the plans. The base hosting plans specification have been architected to meet Microsoft recommended configurations for both SharePoint 2013 and SQL Server 2012 and will include SQL Server and disk configuration best practices identified by HostForLife’s database administrators to optimize SharePoint 2013 performance.

The HostForLIFE.eu SharePoint 2013 product is divided into SharePoint Foundation 2013 and SharePoint Server 2013 hosting plan. SharePoint 2013 Foundation is the core platform of the product which comes with enhancements to the administration and user experience, plus new options for enterprise users to collaborate using social media features. SharePoint Server 2013 is basically Foundation with additional Enterprise services and functionality added on top. You will still get Central administration, basic search, document collaboration, and team sites with Foundation.

For additional information about SharePoint 2013 offered by HostForLIFE.eu, please visit http://www.hostforlife.eu.

About HostForLIFE.eu:

HostForLIFE.eu is European Windows Hosting Provider which focuses on Windows Platform only. We deliver on-demand hosting solutions including Shared hosting, Reseller Hosting, Cloud Hosting, Dedicated Servers, and IT as a Service for companies of all sizes.

HostForLIFE.eu is awarded Top No#1 SPOTLIGHT Recommended Hosting Partner by Microsoft (see www.microsoft.com/web/hosting/HostingProvider/Details/953). Our service is ranked the highest top #1 spot in several European countries, such as: Germany, Italy, Netherlands, France, Belgium, United Kingdom, Sweden, Finland, Switzerland and other European countries. Besides this award, we have also won several awards from reputable organizations in the hosting industry and the detail can be found on our official website.



European ASP.NET MVC 4 Hosting - Amsterdam :: Mobile Features in ASP.NET MVC 4

clock November 15, 2012 07:37 by author Scott

ASP.NET MVC 4 Developer Preview is out and has some nifty new mobile features that will allow you to target mobile devices.

Mobile views

The new “Display Modes” feature lets an application render a specific view based on the device making the request. A desktop browser accessing a page might cause Index.cshtml to be rendered, but if the request comes from an iPad or an Andriod phone, Index.mobile.cshtml may be rendered. This convention-based approach lets you tailor your views without requiring any code changes.

The suffix “mobile” works out of the box, but you can also register your own display modes that target specific devices any particular way you wish. In the global.asax you could register something like the following:

DisplayModes.Modes.Insert(0, new DefaultDisplayMode("iPhone")
{
   ContextCondition = (context => context.Request.UserAgent.IndexOf
       ("iPhone", StringComparison.OrdinalIgnoreCase) >= 0)
});


This will register a mode specifically for iPhones, and allow you to create view pages with “iPhone” as a suffix, such as MyView.iPhone.cshtml.

See the release notes for additional details.

Programmatically detecting a mobile device

You may begin to add some mobile views to your application, only to realize that you actually need to customize more than just the way your views are rendered. Maybe you need to add or remove some of the data your page is querying or do something different altogether. I recently created a mobile version of this blog and couldn’t just use home controller action as-is. I wanted my mobile view to list a summary of all of my blog posts, rather than the full content of just the first 3 posts, which is what you see in a desktop browser.

HttpBrowserCapabilitiesBase browser = HttpContext.GetOverriddenBrowser();

//Some of the many properties, with values as seen from a Windows 7 Phone (emulator):

browser.Type; //IEMobile9

browser.Id; //iemobile
browser.MajorVersion; //9
browser.IsMobileDevice; //true
browser.InputType; //virtualKeyboard
browser.Crawler; //false


Simply call HttpContext.GetOverridenBrowser() to get access to the browser capabilities and you can determine whether it’s mobile, and act accordingly.  This method is an extension method in the System.Web.WebPages assembly, so don’t forget to add a using statement for this namespace!

Overriding the browser type

Detecting a mobile device like this isn’t new, of course. The first version of ASP.NET MVC allowed you to inspect the attributes of the requesting user-agent and chose the proper view to render. The downside of this is that there was no out-of-the-box way for a user to override this. Ever visit a site with your mobile phone and be presented with a stripped down view when you desperately wanted to see the full desktop-browser version, but couldn’t?

MVC 4 has this capability out-of-the-box with the SetOverriddenBrowser() extension method. You can call this and specify a browser type override. This is what the view switcher does in the jQuery.Mobile.MVC sample NuGet package, letting a user select whether they wish to be handled as a desktop or mobile device:

public RedirectResult SwitchView(bool mobile, string returnUrl) {
    if (Request.Browser.IsMobileDevice == mobile)
        HttpContext.ClearOverriddenBrowser();
    else
        HttpContext.SetOverriddenBrowser(mobile ? BrowserOverride.Mobile : BrowserOverride.Desktop);

    return Redirect(returnUrl);
}


The cool stuff comes from HTML5 and jQuery

ASP.NET MVC 4’s mobile features aren’t all that exciting to tell you the truth. The only new features so far are just some helpers and tooling around a technique that’s been around forever. That said, it’s a great addition to the framework.

What's really exciting is the things jQuery Mobile and HTML5 bring to the table, allowing you easily build slick UIs that will look great on a phone or tablet and rival a native application. For more on that, definitely check out the tutorial over on the ASP.NET website that will use these new MVC 4 features and jQuery Mobile.

 



European ASP.NET MVC 4 Hosting - Amsterdam :: ASP.NET MVC 4 Installation Error - Incompatible with .NET 4.5

clock November 1, 2012 09:22 by author Scott

Introduction

When you install ASP.NET MVC 4 for Visual Studio 2010, If you are already using 4.5 framework in your box then you might get some strange errors.

Background

In this case I already having .NET Framework 4.5 RC and I want to install ASP.NET MVC 4 for Visual Studio 2010.

I tried using the standalone installer for ASP.NET MVC 4 for Visual Studio 2010 but it throws me below error



Yes, you’ll see this strange error.
  The error said that Visual Studio 2010 needs .NET Framework 4.5. So, how to fix this error.

Solution


To resolve this issue I removed the .NET Framework
4.5 RC from local box.



And the second is uninstalling the .NET Framework 4.5 also removes pre-existing .NET Framework 4 files. If you want to go back to the .NET Framework 4, you must reinstall it and any updates to it.


If you are not installing .NET Framework 4.0 after uninstallation of Framework 4.5 then you will get another error saying something like 'Framework 4.0 not found".

Hope it helps!



European ASP.NET MVC 4 Hosting - Amsterdam :: How to Upgrade ASP.NET MVC 3 Project to ASP.NET MVC 4 Project

clock October 24, 2012 11:02 by author Scott

ASP.NET MVC 4 can be installed side by side with ASP.NET MVC 3 on the same computer, We can run both version of ASP.NET MVC projects on same machine.

If we would like upgrade an ASP.NET MVC 3 Project to ASP.NET MVC 4 Project, they are multiple ways. The simplest way to upgrade is to create a new ASP.NET MVC 4 project and copy all the views, controllers, code, and content files from the existing MVC 3 project to the new project and then to update the assembly references in the new project to match the old project. If you have made changes to the Web.config file in the MVC 3 project, you must also merge those changes into the Web.config file in the MVC 4 project.


To manually upgrade an existing ASP.NET MVC 3 application to version 4, do the following:


1. In all Web.config files in the project (there is one in the root of the project, one in the Views folder, and one in the Views folder for each area in your project), replace every instance of the following text (note: System.Web.WebPages, Version=1.0.0.0 is not found in projects created with Visual Studio 2012):


System.Web.Mvc, Version=3.0.0.0

System.Web.WebPages, Version=1.0.0.0
System.Web.Helpers, Version=1.0.0.0
System.Web.WebPages.Razor, Version=1.0.0.0

with the following corresponding text:


System.Web.Mvc, Version=4.0.0.0

System.Web.WebPages, Version=2.0.0.0
System.Web.Helpers, Version=2.0.0.0
System.Web.WebPages.Razor, Version=2.0.0.0

2. In the root Web.config file, update the webPages:Version element to "2.0.0.0" and add a new PreserveLoginUrl key that has the value "
true":



3. In Solution Explorer, right-click on the References and select Manage NuGet Packages. Search for Microsoft.AspNet.Mvc and install the Microsoft ASP.NET MVC 4 (RC) package, Click OK.


4. In Solution Explorer, right-click the project name and then select Unload Project. Then right-click the name again and select Edit ProjectName.csproj.


5. Locate the ProjectTypeGuids element and replace
{E53F8FEA-EAE0-44A6-8774-FFD645390401} with {E3E379DF-F4C6-4180-9B81-6769533ABE47}. Save the changes, close the project (.csproj) file you were editing, right-click the project, and then select Reload Project.

6. If the project references any third-party libraries that are compiled using previous versions of ASP.NET MVC, open the root Web.config file and add the following three bindingRedirect elements under the configuration section:




Looking for ASP.NET MVC 4 Hosting? Find an affordable ASP.NET MVC 4 Hosting with HostForLIFE.eu

 



European ASP.NET MVC 4 Hosting - Amsterdam :: ASP.NET Single Page Application

clock October 22, 2012 09:23 by author Scott

What is Single Page Application?

Single Page Application is an architecture for web applications. It combines the best of web and desktop, built with HTML5 and JavaScript.Single Page Applications are rich and responsive. You do not need any browser plug-ins needs to install for this architecture, it is a standard web technology that is going to work on any device, operating system and browser.

The reference for this post is http://channel9.msdn.com/Events/TechDays/Techdays-2012-the-Netherlands/2159 from Steve Sanderson’s Techdays talk,

You can develop Single Page Applications using ASP.NET MVC\Web Forms technologies.

Benefits

1. Great user experience
– It means speed, when it comes to changing of display of user interface and navigate around, we want an instance response from the application which you can get from this architecture.

2. Run on any device

3. Working off-line
– It is an interesting benefit which is just becoming possible now.

4. App-store deployable
- It is bit advanced programming but you can deploy your applications to windows market place or Apple app-store etc. This is now possible with Phone-gap third party tool for developing apps for mobiles.

The Architecture diagram looks as below



Typical Web architecture contains a server and client, where server contains an endpoint to server HTML/CSS and JS. The client side this being rendered as Visible UI and contains some javascript as well that is web technology.


What is different in Single Page Applications?

With single page web applications, you also tend to have an data end points on server and it is going to return JSON\XML to your application, You can use this data on client data access layer and render that data to UI.


We also want to have fast UI navigation, to done that we have Navigation API which allows you to book marking, navigate forth and back without talking to the server.

We can also make available all right hand side in the diagram offline. You can use local storage apis in HTML5 to work with the data offline.

Using the new Single Page Application project template and scaffolder

Create a new ASP.NET MVC application in Visual Studio, You can install MVC4 beta from here.



It will prompt you to select the project template there you can select Single Page Application project template as shown below



It creates a MVC application but the difference is it creates additional javascript libraries to make it easier for you build single page applications. If you want to use scaffolding then you can use a model class named TodoItem which will be created for you in model folder

To build a sample Single Page application using scaffolding, Add a controller to your solution



Choose the Single Page application template in controller dialogue box



Now run the application then you should be able to see the below output



What is different from other scaffolding applications is it follows single page application architecture and when you hit the browser back and forward it would not talk to the server. It also follows the all principles that we discussed on top.

 



European ASP.NET MVC Hosting - Amsterdam :: Use ASP.NET MVC Validation Attributes outside of ASP.Net

clock October 15, 2012 06:34 by author Scott

Some people love them, others absolutely hate them, but if you ask me one of the coolest features in ASP.Net MVC is the Data Annotations that you use to decorate your ASP.Net MVC classes for validation. But one of the coolest things that came along in .Net 4.0 was support for this across the whole framework – even outside of ASP.Net MVC!

When working on projects outside of ASP.Net MVC its still just as relevant to write validation for your classes and their respective properties before you fire actions, communicate them to another class or simply add something to a database (among the 4 million other times validation can come in handy).


Taking what we know from ASP.Net MVC, we can easily add this functionality to the public properties of any class in any project in .Net 4, be it a Console App, Web Service, SilverLight, Windows Phone 7 – you name it.


This also means that any common libraries you use between multiple projects can have simple Data Annotations added in one place and validated everywhere – keeping your validation logic all in one place.


Getting down to business

In the project that holds the data model classes you want to add validation to, add a reference to the framework namespace
System.ComponentModel.DataAnnotations



Now open the class you want to add validation to.


We are going to add the following to it:


- Add a class level meta data attribute telling our validator what type of class it is

- Add your validation decorations to any properties exactly as you would in ASP.Net MVC

In my example below, I demonstrate how to do this with a class named Person. You can see I've added a MetadataTypeAttribute of type Person above the class declaration. I’ve also added a required field decoration to the public Name property of this class.


[
MetadataTypeAttribute(typeof(Person))]
class
Person
{

    [Required(ErrorMessage = "You must enter a name")]
    public string Name { get; set; }
}


Now I've got to create a new class that we will use to validate our decorated attributes against objects – in this instance our Person class above, but the same code will work for any class with the correct decorations.


Create a new class in your project and call is
ClassValidator.

Paste the following code into that file:


public class
ClassValidator
{

    public ClassValidator(object objectToValidate)
    {
        objectBeingValidated = objectToValidate;
    }

    private static object objectBeingValidated { get; set; }

    public List<ValidationResult> ValidationErrors { get; private set; }

    public bool IsValid()
    {
        if (objectBeingValidated != null)
        {
            ValidationErrors = new List<ValidationResult>();
            var context = new ValidationContext(objectBeingValidated,
                null,
                null);

            bool isValid = Validator.TryValidateObject(objectBeingValidated,
                context,
                ValidationErrors);

            if (!isValid)
            {
                return false;
            }
            return true;
        }
        return false;
    }
}


And we are done - That is all we need!


Using the Code

To use the above example, all you need to do, is create an instance of our ClassValidator and pass in the object we want to validate at initialisation.


We can then call the IsValid() method against it to find out if our class validates and a list of any validation errors will then be available in the public ValidationErrors property of our ClassValidator.

My example below demonstrates this usage in a console application that does the following:

-
Creates an instance of the example Person object
- Doesn’t set any properties of this Person object (so our Name property will be Null - and therefore invalid)
-
Creates a ClassValidator and passes in my newly created Person, and then calls IsValid against it.
-
Prints all the errors found to the console.

Person p = new Person();


Console.WriteLine("Attempting to validate the person object");


ClassValidator validator = new ClassValidator(p);


Console.WriteLine("Is object valid of not?: {0}",validator.IsValid());


foreach
(var error in validator.ValidationErrors)
{

    Console.WriteLine("Error in Person object: {0}", error.ErrorMessage);
}

 



HostForLIFE.eu now supports Windows Server 2012 Hosting Platform in European Data Center

clock October 1, 2012 08:05 by author Scott

Microsoft has just officially released the highly anticipated Windows Server 2012. The newly released server operating system offers a number of features that can be utilized to benefit developers, resellers and businesses. As a premier European Windows and ASP.NET hosting provider that follow the developments of Microsoft products, HostForLIFE.eu proudly announces the support of Windows Server 2012 Hosting Platform in the world-class Amsterdam (The Netherlands) data center.

“We know that our customers are always looking for new technologies and the latest Microsoft product. With the launch of Windows Server 2012, we believe that anyone can take advantage of all the improvements available in this platform”, said Manager of HostForLIFE.eu, Kevin Joseph. “The focus on high availability, scalability, and virtualization has made this one of the most important releases of Windows Server to date. We have been working closely with Microsoft throughout the pre-release development cycle of the platform to both drive the direction of the product and ensure our team is ready to support Server 2012 solutions. We couldn’t be more excited and confident in the solutions now available to our clients with Windows Server 2012.”


With our Windows Server 2012 Hosting Platform, customers have an access directly to all the newest technologies and frameworks, such as ASP.NET 4.5 Hosting, ASP.NET MVC 4 Hosting, Silverlight 5 Hosting, WebMatrix Hosting, Visual Studio Lightswitch Hosting and SQL 2012 Hosting. All these technologies/frameworks are integrated properly on our world-class Control Panel. The package is offered from just €2.45/month and we believe that this is the most affordable, features-rich Windows and ASP.NET Hosting package in European market.


HostForLIFE.eu is awarded Top No#1 SPOTLIGHT Recommended Hosting Partner by Microsoft (see
http://www.microsoft.com/web/hosting/HostingProvider/Details/953). Our service is ranked the highest top #1 spot in several European countries, such as: Germany, Italy, Netherlands, France, Belgium, United Kingdom, Sweden, Finland, Switzerland and other European countries. Besides this award, we have also won several awards from reputable organizations in the hosting industry and the detail can be found on our official website.

For more information about our service, please visit
http://www.hostforlife.eu.

About HostForLIFE.eu:


HostForLIFE.eu is European Windows Hosting Provider which focuses on Windows Platform only. We deliver on-demand hosting solutions including Shared hosting, Reseller Hosting, Cloud Hosting, Dedicated Servers, and IT as a Service for companies of all sizes.


Our number one goal is constant uptime. Our data center uses cutting edge technology, processes, and equipment. We have one of the best up time reputations in the industry.


Our second goal is providing excellent customer service. Our technical management structure is headed by professionals who have been in the industry since its inception. We have customers from around the globe, spread across every continent. We serve the hosting needs of the business and professional, government and nonprofit, entertainment and personal use market segments.



European ASP.NET MVC 4 Hosting - Amsterdam :: Implementing custom XmlMediaTypeFormatter that ignores XML namespaces in ASP.NET MVC 4

clock September 11, 2012 07:31 by author Scott

In this blog post I will show how to implement a custom XmlMediaTypeFormatter that extends the default ASP.NET Web API XmlMediaTypeFormatter in a way that it ignores XML namespaces when parsing xml messages.

By default the ASP.NET Web API
XmlMediaTypeFormatter is not able to parse XML requests that contain any XML namespace declarations. If you would like to support clients, that (for any reason) send messages containing XML namespaces you can use the IgnoreNamespacesXmlMediaTypeFormatter that is defined as follows:

public
class IgnoreNamespacesXmlMediaTypeFormatter : XmlMediaTypeFormatter
{

  // See http://wiki.tei-c.org/index.php/Remove-Namespaces.xsl
  private const string NamespaceRemover =
    @"<xsl:stylesheet version='1.0' xmlns:xsl='http://www.w3.org/1999/XSL/Transform'>
        <xsl:output method='xml' indent='no'/>
        <xsl:template match='/|comment()|processing-instruction()'>
          <xsl:copy>
            <xsl:apply-templates/>
          </xsl:copy>
        </xsl:template>
        <xsl:template match='*'>
          <xsl:element name='{local-name()}'>
            <xsl:apply-templates select='@*|node()'/>
          </xsl:element>
        </xsl:template>
        <xsl:template match='@*'>
          <xsl:attribute name='{local-name()}'>
            <xsl:value-of select='.'/>
          </xsl:attribute>
        </xsl:template>
      </xsl:stylesheet>";

  private readonly XslCompiledTransform _xlstTransformer;

  public IgnoreNamespacesXmlMediaTypeFormatter()
  {
    var xslt = XDocument.Parse(NamespaceRemover, LoadOptions.PreserveWhitespace);
    _xlstTransformer = new XslCompiledTransform();
    _xlstTransformer.Load(xslt.CreateReader(), new XsltSettings(), new XmlUrlResolver());
  }

  public override Task<object> ReadFromStreamAsync(Type type, Stream stream, HttpContentHeaders contentHeaders, IFormatterLogger formatterLogger)
  {
    try
    {
      // Read XML
      var xmlDocument = XDocument.Load(new XmlTextReader(stream));

      // Transform XML
      var resultStream = new MemoryStream();
      _xlstTransformer.Transform(xmlDocument.CreateReader(), XmlWriter.Create(resultStream, new XmlWriterSettings() { OmitXmlDeclaration = true }));
      resultStream.Position = 0;

      // Process request with XmlMediaTypeFormatter default functionality
      return base.ReadFromStreamAsync(type, resultStream, contentHeaders, formatterLogger);
    }
    catch (XmlException)
    {
      return base.ReadFromStreamAsync(type, stream, contentHeaders, formatterLogger);
    }
  }
}


In detail the
IgnoreNamespacesXmlMediaTypeFormatter removes the XML namespace declarations from the XML message and passes the modified XML to the base class to use the default XmlMediaTypeFormatter functionality. Removing the XML namespaces is done with a XSLT transformation (see http://wiki.tei-c.org/index.php/Remove-Namespaces.xsl).

To activate the
IgnoreNamespacesXmlMediaTypeFormatter add the following lines in the file Global.asax.cs:

protected
void Application_Start()
{

  [...]
  // Remove default XmlFormatter and add (customized) IgnoreNamespacesXmlMediaTypeFormatter

GlobalConfiguration.Configuration.Formatters.Remove(GlobalConfiguration.Configuration.Formatters.XmlFormatter);

  var ignoreNamespacesXmlMediaTypeFormatter = new IgnoreNamespacesXmlMediaTypeFormatter{ UseXmlSerializer = true };

GlobalConfiguration.Configuration.Formatters.Add(ignoreNamespacesXmlMediaTypeFormatter);

  [...]
}

 



European ASP.NET MVC 4 Hosting - Amsterdam :: Heads up on a hidden breaking change in ASP.NET MVC 4

clock August 24, 2012 07:51 by author Scott

If you use an Editor Template for DateTime and use the DataTypeAttribute with either or DataType.Date and DataType.DateTime in ASP.NET MVC 2 or 3 and happen to upgrade to ASP.NET MVC 4 be aware!

ASP.NET MVC 4 introduces two new internal editor templates for properties marked as DataType.Date and DataType.DateTime to render HTML5 input types (date and datetime accordingly).

The unexpected side-effect of this is that if you were previously capturing all DateTime type editing through a DateTime editor template now if your property is marked as DataType.Date ASP.NET MVC 4 will use the new internal Date editor template instead of your DateTime editor template.

The solution is to provide a Date.cshtml editor template along your DateTime.cshtml editor template.

 



About HostForLIFE

HostForLIFE is European Windows Hosting Provider which focuses on Windows Platform only. We deliver on-demand hosting solutions including Shared hosting, Reseller Hosting, Cloud Hosting, Dedicated Servers, and IT as a Service for companies of all sizes.

We have offered the latest Windows 2019 Hosting, ASP.NET 5 Hosting, ASP.NET MVC 6 Hosting and SQL 2019 Hosting.


Month List

Tag cloud

Sign in