European ASP.NET MVC 4 and MVC 5 Hosting

BLOG about ASP.NET MVC 3, ASP.NET MVC 4, and ASP.NET MVC 5 Hosting and Its Technology - Dedicated to European Windows Hosting Customer

ASP.NET MVC 6 Hosting Europe - HostForLIFE.eu :: ASP.NET MVC 6 Overview

clock June 16, 2014 13:28 by author Peter

Good News! Microsoft has been released ASP.NET MVC 6 on 12 May 2014 at TechEd North America, as part of ASP.NET vNext, the MVC, Web API, and Web Pages frameworks will be merged into one framework. Microsoft feels that System.Web needs to be removed because it is actually quite expensive. A typical HttpContext object graph can consume 30.000 of memory per request. When working with small JSON-style requests this represents a disproportionately high cost. With ASP.NET MVC 6 new design, the pre-request overhead drops to roughly 2000.

The new ASP.NET MVC 6 assumes you are familiar with either MVC 5 or Web API 2. If not, here is some terminology that is used in ASP.NET MVC. The new framework removes a lot of overlap between the existing MVC and Web API frameworks. It uses a common set of abstractions for routing, action selection, filters, model binding, and so on. You can use the framework to create both UI (HTML) and web APIs.

Features of ASP.NET vNext & ASP.NET MVC 6

  • A controller handles HTTP requests and executes application logic.
  • Actions are methods on a controller that get invoked to handle HTTP requests. The return value from an action is used to construct the HTTP response.
  • Razor syntax is a simple programming syntax for embedding server-based code in a web page.
  • Routing is the mechanism that selects which action to invoke for a particular HTTP request, usually based on the URL path and the HTTP verb.
  • A view is a component that renders HTML. Controllers can use views when the HTTP response contains HTML.
  • ASP.NET vNext includes new cloud-optimized versions of MVC, Web API, Web Pages, SignalR, and Entity Framework.
  • The welcome page is not too interesting, so lets’s enable the app to serve static files.
  • Mono is a Supported Platform. In the past the support story for Mono was essentially “we hope it runs, but if it doesn’t then you need to talk to Xamarin”. Now Microsoft is billing Mono as the official cross-platform CLR for ASP.NET vNext.
  • ASP.NET vNext support true side-by-side deployment. If your application is using cloud-optimized subset of ASP.NET vNext, you can deploy all of your dependencies including the .NET vNext (cloud optimized) by uploading bin to hosting environment.
  • Cross Platform Development. Not only is Microsoft planning for cross-platform deployment, they are also enabling cross-platform development.



ASP.NET MVC 6 Hosting South Africa - HostForLIFE.eu :: How to Create a RSS feed with the new ASP.NET MVC 6

clock June 13, 2014 11:10 by author Peter

Today, we are going to discuss about create RSS feed on ASP.NET MVC 6 Hosting. The RSS classes that we will be describing are available in all types of ASP.NET applications, not only the web-based onces. But we think displaying a blog item on your website is great and relatively simple example of consuming RSS feeds in ASP.NET.

There actually is built-in RSS support in ASP.NET. We have not been aware of that support for some time and occasionally used the third-party library RSS.NET. It turns out that we do not need a separate library any longer. Here is an example MVC controller that refers to the SyndicationFeed and SyndicationItem classes in its Index action method.

using System.Web.Mvc;
using System.ServiceModel.Syndication;
using System.Xml;
using System.Linq;namespace Antrix.Web.Controllers
{
    public class HomeController : Controller
    {
        public ActionResult Index()
        {
            ViewBag.Message = "Welcome to ASP.NET MVC!";
            const string feedUrl =
            "http://yourdomain.com/feeds/posts/default?alt=rss";
           SyndicationFeed feed = null;
           using (XmlReader reader = XmlReader.Create(feedUrl))
            {
                feed = SyndicationFeed.Load(reader);
            }
            if (feed != null)
            {
                SyndicationItem item = feed.Items.First<SyndicationItem>();

                ViewBag.RssItem = item;         
            }
           
             return View();
        }
        public ActionResult About()
        {
            return View();
       }
    }
}

The Index method will reads a feed of the site that you are reading right now. It puts the first item (which we assume represents the last post that has been published) in the ViewBag. Normally we use model classes to refer to data within my MVC views, but we want to keep things simple. We have added code to show the title and summary of the last post, and a link to the full post.

@{
    ViewBag.Title = "Home Page";
}
<h2>@ViewBag.Message</h2>
<p>

    To learn more about ASP.NET MVC visit <a href="http://asp.net/mvc" title="ASP.NET MVC Website">http://asp.net/mvc</a>.
</p>
<div>

From our blog:  
<div style="font-weight: bold; padding: 10px">@ViewBag.RssItem.Title.Text</div>
<div style="clear: both; padding: 10px">@Html.Raw(@ViewBag.RssItem.Summary.Text)</div>
<div style="clear: both; padding: 10px"><a href="@ViewBag.RssItem.Links[0].Uri" target="_blank">Show full post</a></div>
</div>

Using the SyndicationFeed and SyndicationItem classes it becomes rather easy to create your own web-based (or Windows-based, if you prefer) RSS reader.



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.

We have offered the latest Windows 2016 Hosting, ASP.NET Core 2.2.1 Hosting, ASP.NET MVC 6 Hosting and SQL 2017 Hosting.


Tag cloud

Sign in