European ASP.NET MVC Hosting

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

European ASP.NET MVC 5 Hosting - UK :: Using Bootstrap 3 in ASP.NET MVC 5

clock October 21, 2014 10:00 by author Scott

In this article, we will describe about ASP.NET MVC 5 uses Bootstrap 3 as the CSS framework. You can check our last article about asp.net mvc 5 scaffolding.

Get Started with ASP.NET MVC 5

When you create a new ASP.NET MVC 5 Web Application in Visual Studio 2013 it is using Bootstrap 3 as its default CSS Framework. You get the pleasure of the responsive navigation and website along with all the typography and other bells and whistles you expect from Bootstrap 3.

Inside the ASP.NET MVC 5 Website Template you will find the bootstrap.css and bootstrap.min.css stylesheets as well as the bootstrap.js and bootstrap.min.js scripts. The _Layout.cshtml view and other views are marked up appropriately using the CSS selectors in Bootstrap 3.

ASP.NET MVC 5 Bootstrap

By default, the ASP.NET MVC Website Template uses a couple of bundles that use both Bootstrap 3 CSS as well as Modernizr. Check out the Layout.cshtml view to see the use of two of the bundles.

  @Styles.Render("~/Content/css")
 
@Scripts.Render("~/bundles/modernizr")

You will find these bundles configured in the BundleConfig.cs file in App_Start.

  bundles.Add(new ScriptBundle("~/bundles/modernizr").Include(
    
"~/Scripts/modernizr-*"
));

  bundles
.Add(new StyleBundle("~/Content/css").Include(
    
"~/Content/bootstrap.css"
,
    
"~/Content/site.css"
));

And, of course, the CSS selectors and markup in the new ASP.NET MVC 5 Views are based on Bootstrap 3.

That’s only brief tutorial about ASP.NET MVC 5. We will be back with new tutorial again.

 

 



European HostForLIFE.eu Proudly Launches PrestaShop 1.6 Hosting

clock October 16, 2014 09:20 by author Peter

HostForLIFE.eu, a leading Windows web hosting provider with innovative technology solutions and a dedicated professional services team, today announced the support for PrestaShop 1.6 Hosting plan due to high demand of PrestaShop 1.6 users in Europe. HostForLIFE.eu hosts its servers in top class data centers that is located in Amsterdam, London and Seattle (US) to guarantee 99.9% network uptime. All data center feature redundancies in network connectivity, power, HVAC, security, and fire suppression. All hosting plans from HostForLIFE.eu include 24×7 support and 30 days money back guarantee.

PrestaShop 1.6 is a free and open-source e-commerce web application, committed to providing the best shopping cart experience for both merchants and customers. It is written in PHP, is highly customizable, supports all the major payment services, is translated in many languages and localized for many countries, is fully responsive (both front- and back-office), etc. PrestaShop 1.6 offers new and improved navigation elements making navigating your online shop easier and more effective than ever.

PrestaShop 1.6 presents a comprehensive, intuitive user administration panel, and gives you hundreds of standard functions that can be adapted or personalized in order to respond to all of customer needs. The front office template on PrestaShop 1.6 is now mobile responsive, allowing customer online shop to display perfectly when accessed from a mobile and tablet device.

At the forefront of the latest innovative web technology, PrestaShop 1.6 integrates with Bootstrap 3.0, FontAwesome, Sass Compass and D3 Data Driven Documents. Online Shopping has never been so technologically brilliant. A unique e-commerce feature you will only find in PrestaShop 1.6, Net Profit Margin is automatically updated in real-time.

Further information and the full range of features PrestaShop 1.6 Hosting can be viewed here http://hostforlife.eu/European-PrestaShop-16-Hosting

About HostForLIFE.eu
HostForLIFE.eu is an European Windows Hosting Provider which focuses on the Windows Platform only. HostForLIFE.eu 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 http://www.microsoft.com/web/hosting/HostingProvider/Details/953). 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 other European countries. Besides this award, they have also won several awards from reputable organizations in the hosting industry and the detail can be found on their official website.



European ASP.NET MVC 5 Hosting - UK :: ASP.NET MVC 5 Scaffolding

clock October 13, 2014 07:28 by author Scott

In this article, I will show you how to use Scaffolding With your ASP.net MVC 5 Application. I assume that you all know about scaffolding and I don’t need to explain it again. In our previous post, we have also explained about Scaffolding with the Repository Pattern in ASP.NET MVC 3.

In this article, we will be more focus in adding scaffolded item to ASP.net MVC 5.

1. Let's create an ASP.net MVC 5 web application in Visual Studio 2013 and name it as ScaffoldingMVC5.

2. Right click your Controllers folder and Add New Scaffolded Item is as below.

3. From the Add Scaffold window, select the MVC 5 Controller with views,using Entity Framework scaffold template.

4. Add a controller. Please see the below screenshot

Then, please fill a name for your Data context as below, for example DataContext

5. You have done great job and this is the result

Testing the Result

Index Page

Create Page

Details Page

Edit Page

Delete Page

All above CRUD operations were generated according to our Model class Pet.

Pet.cs

Key points of the above code

  • [ScaffoldColumn(false)] means,the property which it declared will not use for scaffolding.In other words, that property will not be shown on the UI (i.e. Created property will not be shown).
  • Data validations of the form elements are happening ,according to the above model's Data Annotation values.
  • Let's explore it.

If you click the Create button, without entering anything.What will happen ?

What if you try to enter a wrong data type ?

 


Calender has been shown, if it's a DateTime property.

Great, right?



ASP.NET MVC 6 Hosting - HostForLIFE.eu :: Updating Multiple Row Using ASP.NET MVC and Entity Framework

clock October 7, 2014 12:11 by author Peter

In this post we are going to update multiple row using ASP.NET MVC and Entity Framework.  Just follow these steps below:
1. First we need to create a project.
Go to Menu File > New > Project > Select ASP.NET MVC web application > Entry Application Name > Click OK.


2. Add a Database.
Go to Solution Explorer > Right Click on App_Data folder > Add > New item > Select SQL Server Database Under Data > Enter Database name > Add. 
Open Database and add a table for update operation. Here I am creating a table called Contacts.

3. Add Entity Data Model.
Go to Solution Explorer > Right Click on Project Name from Solution Explorer folder > Add > New item > Select ADO.net Entity Data Model under data > Enter model name > Add.
A popup window will come (Entity Data Model Wizard) > Select Generate from database > Next > Chose your data connection > select your database > next > Select tables > enter Model Namespace > Finish.

After Creating Data model, we have to modify our generated entity(table) for Apply validation for required fields.

Here we need to modify contact.cs fileOpen file and modify as for enable validation.
namespace UpdateMultiRecord
{
    using System;
    using System.Collections.Generic;
    using System.ComponentModel.DataAnnotations;
    public partial class Contac
  {
        [Required]        
        public int ContactID { get; set; }
        [Required]
        public string ContactPerson { get; set; }       
 [Required]
        public string Contactno { get; set; }
        public string EmailID { get; set; }
    }
}


Here I am using Home controller index action.

Get Action      
[HttpGet]
        public ActionResult Index()
        {
            List<Contact> model = new List<Contact>();
            using (MyDatabaseEntities dc = new MyDatabaseEntities())
            {
                model = dc.Contacts.ToList();
            }
            return View(model);

        }     
Post Action       
 [HttpPost]
        public ActionResult Index(List<Contact> list)
        {
           if (ModelState.IsValid)
           {
               using (MyDatabaseEntities dc = new MyDatabaseEntities())
                {
                    foreach (var i in list)
                    {

                        var c = dc.Contacts.Where(a =>                                  
                        a.ContactID.Equals(i.ContactID)).FirstOrDefault();
                        if (c != null)
                        {
                            c.ContactPerson = i.ContactPerson;
                            c.Contactno = i.Contactno;
                            c.EmailID = i.EmailID;
                        }
                    }
                    dc.SaveChanges();
                }
                ViewBag.Message = "Successfully Updated.";
                return View(list);
            }
            else
            {
               ViewBag.Message = "Failed ! Please try again.";
                return View(list);
            }
        }       
Create View for Update Multiple Row.
@model List<UpdateMultiRecord.Contact>
@{
    ViewBag.Title = "Update multiple row at once Using MVC 4 and EF ";
}
@using (@Html.BeginForm("Index","Home", FormMethod.Post))
{
    <table>
            <tr>
                <th></th>               
                <th>Contact Person</th>
                <th>Contact No</th>
                <th>Email ID</th>
            </tr>
        @for (int i = 0; i < Model.Count; i++)
        {
            <tr>               
                <td> @Html.HiddenFor(model => model[i].ContactID)</td>
                <td>@Html.EditorFor(model => model[i].ContactPerson)</td>
                <td>@Html.EditorFor(model => model[i].Contactno)</td>
                <td>@Html.EditorFor(model => model[i].EmailID)</td>
            </tr>
        }
    </table>
    <p><input type="submit" value="Save" /></p>
    <p style="color:green; font-size:12px;">
        @ViewBag.Message
    </p>
}
 @section Scripts
     {@Scripts.Render("~/bundles/jqueryval")}

Code: @Scripts.Render("~/bundles/jqueryval") will enable client side validation. Finally, Run Application. Edit Contact Details and Click Save button.



HostForLIFE.eu Proudly Launches Hosting with SiteLock Malware Detector

clock October 6, 2014 06:29 by author Peter

HostForLIFE.eu, a leading Windows web hosting provider with innovative technology solutions and a dedicated professional services team, today announced the support of SiteLock Malware Detector on all their newest hosting environments. HostForLIFE.eu Hosting with SiteLock Malware Detector plan starts from just as low as $36.00 / year only and this plan has supported daily malware scan, trust seal, application scan, TrueSpeed CDN, etc.

HostForLIFE.eu offers the greatest performance and flexibility hosting with SiteLock Malware Detector at an economical price. HostForLIFE.eu provides flexible hosting solutions that enable their company to give maximum uptime to customer. SiteLock monitors your website 24x7 for vulnerabilities and attacks, which means you can worry less about your website and more about your business.

SiteLock is a cloud-based, website security solution for small businesses. It works as an early detection alarm for common online threats like malware injections, bot attacks etc. It not only protects websites from potential online threats, but also fixes vulnerabilities. With the presence of SiteLock, your website will be protected and scanned against viruses, spyware, malware, identity theft and other online scams. Note that, as they rely more and more on internet technology, these online viruses and scams become bigger and smarter to handle.

Over 70% Customers look for a sign of security before providing personal details online. The SiteLock Trust Seal not only re-assures customers, but also boosts sales. The customer doesn’t need technical ability to install and set up SiteLock for their website. SiteLock is cloud-based and starts scanning website and email instantly.
With this SiteLock feature, you can be assured that you will always be one step ahead of online hackers and swindlers’ illegal intentions. With more than 6 years in the web hosting business, HostForLIFE’s technical staff is more than ready on its feet to develop and tackle viruses, malware and the likes to sustain the safe and reliable use of your website.

Further information and the full range of features hosting with SiteLock Malware Detector can be viewed here http://www.hostforlife.eu/Hosting-with-Sitelock-Malware-Detector-in-Europe



ASP.NET MVC 6 Hosting Europe - HostForLIFE.eu :: Creating Hybrid SPA with ASP.NET MVC, WebAPI and AngularJs

clock October 2, 2014 08:10 by author Peter

The main benefit I see in following the SPA design principles for developing rich, complex web applications is the “stateful”ness we get. For complex web application, it may be too idealistic to have just one “full” initial HTTP request to get a page, and then subsequent async calls to load further pages or data. However, we can do it module-wise i.e. certain parts of the web app follow SPA design, others may or may not follow SPA design. This is referred to as mini-spa or hybrid spa. Using AngularJs in ASP.NET MVC 6 Hosting, I have come up with a sample application which follows SPA design principles. I’m using angular route module ngRoute along with angular directive ngView to define routes – controller & view associated with each route. It is essentially MVC pattern on the client-side. Moreover, our app is now route-driven on client-side. (The browser back and fro buttons are supported)

In the sample web app, we have 2 modules. In each module, user can filter results and view/edit the record. [NOTE: using mvc music store database from CodePlex.

For each module, I've defined corresponding angular module :
ngModule musicAlbumsApp for music module
ngModule movieDvdsApp for movie module

Route configuration for music module

(function (app) {
    var routeConfig = function ($routeProvider) {
        $routeProvider.when("/", {
            controller: "musicAlbumListController",
            templateUrl: window.miniSpaApp.rootUrl + "MusicAlbums/List",
            reloadOnSearch: false
        }).when("/:genreId", {
            controller: "musicAlbumListController",
            templateUrl: window.miniSpaApp.rootUrl + "MusicAlbums/List",
            reloadOnSearch: false
        }).when("/Detail/:id", {

            controller: "musicAlbumDetailController",
            templateUrl: window.miniSpaApp.rootUrl + "MusicAlbums/Detail",
            reloadOnSearch: false        }).when("/Edit/:id", {
            controller: "musicAlbumEditController",
            templateUrl: window.miniSpaApp.rootUrl + "MusicAlbums/Edit",
            reloadOnSearch: false
        }).otherwise({ redirectTo: "/" });
    };
    routeConfig.$inject = ['$routeProvider'];
    app.config(routeConfig);
})(angular.module("musicAlbumsApp"));

Each route maps to an angular controller and a view/template. 

In our main page (MusicAlbums - Index View), we include the angular scripts and define our container div using ngView directive to load different views

@section HeadContent
{
   @Scripts.Render("~/bundles/angularMusicAlbums")
}
<div data-ng-app="musicAlbumsApp" data-ng-view="" data-ng-cloak="">
</div>


Similarly, for movie module we've defined it's route configuration and container div using ngView directive.



European ASP.NET MVC 5 Hosting - UK :: How to Fix Error Could not load file or assembly 'Microsoft.Web.Infrastructure'

clock September 24, 2014 07:39 by author Scott

We believe that some of you get this error when deploying your ASP.NET MVC 5 to shared hosting:

[FileNotFoundException: Could not load file or assembly 'Microsoft.Web.Infrastructure, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.]

Previously, we have written blog about how to deploy your MVC to shared hosting environment. In this tutorial, we will be more focusing on above error message.

This is also one of a few component libraries that are needed for deploying an MVC application:

  • System.Web.Helpers.dll (required by the web.config)
  • System.Web.Mvc.dll
  • System.Web.Razor.dll
  • System.Web.WebPages.dll
  • System.Web.WebPages.Razor.dll
  • Microsoft.Web.Infrastructure.dll

The system libraries are installed with .NET 4, however, 'Microsoft.Web.Infrastructure.dll' is only installed when Visual Studio is installed on the machine.  Therefore, short of needing to install MVC and Visual Studio on a production environment, we need to deploy the libraries with out application - and we'd like to do so automatically.

There are a few ways to automatically deploy the 'Microsoft.Web.Infrastructure.dll' component library with your application.  The steps depend on which version of Visual Studio you are using.

1. Right-click on your project and select "Add Deployable Assemblies" and you'll see the following dialog:

2. When deploying for MVC, only choose the first option.  Never mind the second option even though it says "Razor syntax." The second option is for deploying the required libraries for projects officially known today as ASP.NET Web Pages. Once you click OK, you'll see a new folder appear in your project called _bin_deployableAssemblies with the required libraries.

For .NET, this is a special folder:

  • This is a secondary bin folder for framework dependencies.  If you right-click on any one of the .dll's shown in this folder, you'll see that the libraries are set to "Copy to Output Directory".  When the application is packaged/deployed, the libraries (and the folder) are also copied.  Again, the framework will also automatically check this folder for dependencies.
  • For .NET, any folder that begins with an underscore ("_") is considered private and non-accessible to the browser.  Therefore, you can rest knowing that the dependencies are secure.

Note that this process did not add any references to these libraries in your project.  They are simply here for the framework to run your MVC application.  If you do, in fact, need a type or class from one of these libraries, you are free to still add it as a reference as you normally would.

The above method is for Visual Studio 2010. How about in Visual Studio 2012? Then, please stay here, don’t exit from our blog. We almost finish our tutorial. Stay focus. :)

After Visual Studio 2010, the "Add Deployable Assemblies" option was removed from the project's options menu.  The system libraries are automatically copied to the Bin folder of your project. However, again, the 'Microsoft.Web.Infrastructure.dll' is only available on machines that have Visual Studio installed.  So how do you deploy this library with you application if you don't want to install Visual Studio on a production environment?  I'm glad you asked.  You'll need to use the Package Manager.

1. Run the following command in the package manager (if you're not familiar with Visual Studio, this can be reached by going to "Tools --> Library Package Manager --> Package Manager Console" in the top menu).

2. At the PM> prompt type

Install-Package Microsoft.Web.Infrastructure

3. You will see then see a message indicating that it has been installed and added to your project.

4. You'll also see that 'Microsoft.Web.Infrastructure.dll' has been added as a reference in your References folder.

5. Finally, now, when you deploy your application, 'Microsoft.Web.Infrastructure.dll' will be included in the Bin folder.

Conclusion

We hope with tutorial above, you can easily deploy your MVC application without any problem. If this article, please share it!! Please tell the world. :)



ASP.NET MVC 6 Hosting - HostForLIFE.eu :: How to Solve HTTP Error 403.14 and Error 404 When Deploying ASP.NET MVC 6 website on IIS

clock September 17, 2014 08:59 by author Peter

I have build a ASP.NET 4.5 and ASP.NET MVC 6 web app which works fine locally (IIS Express & dev server) but once I deploy it to my web server, sometimes it throws Error:

  • 403.14 - Forbidden (The Web server is configured to not list the contents of this directory.)
  • 404 - Not Found (The resource you are looking for has been removed, had its name changed, or is temporarily unavailable)

SOLUTION

  • Make sure the Application pool targets correct version of .NET framework (i.e .NET Framework v4.0.30319 for .NET 4.5 and 4.5.2)
  • Make sure You have setup the website as an application in IIS
  • Make sure the Pipeline mode of IIS Application pool is "Integrated"
  • Check UrlRoutingModule-4.0 is added in the modules of that website.
  • (To do that, open list of added modules by clicking "Modules" against your website, and see if the module "UrlRoutingModule-4.0" is added or not). If not, then add a module by clicking "Add Managed Module" button, where select System.Web.Routing.UrlRoutingModule as a Module type, and give "UrlRoutingModule-4.0" as its name)
  • Make sure you have following element added in system.webServer section of website's web.config

<system.webServer>
<modules runAllManagedModulesForAllRequests="true"></modules> 
</system.webServer>

In most cases of HTTP Error 403.14, or 404, above are the possible causes and fixes. 



ASP.NET MVC 6 Hosting - HostForLIFE.eu :: Displaying Validation Errors with ASP.NET MVC

clock September 9, 2014 09:33 by author Peter

We all know how important it is to validate user input, but it’s equally important how we present validation errors to the user. Take the following form you can see below:

The email field needs to be optional but any address entered must be valid. If a validation error occurs, it should replace the optional label with the error message. Behind the scenes I’m using Data Annotations to validate the email address, so any errors will be passed into the ModelState. ASP.NET MVC 6 has built-in support for showing these errors (using the ValidateMessageFor helper) so it’s easy to write a wrapper around that, supplying the ‘optional’ text as a parameter.

Here’s an extension method for the HtmlHelper:
public static class ExtensionMethods

{
 public static MvcHtmlString HelpMessageFor<TModel, TProperty>(this HtmlHelper<TModel> htmlHelper, Expression<Func<TModel, TProperty>> expression, string helpText)
{
        var validation = htmlHelper.ValidationMessageFor(expression);
        if (validation == null)
            return new MvcHtmlString("<span class='help-inline muted'>" + helpText + "</span>");
        else
            return validation;
    }
}

Here’s it’s usage:

<fieldset>
  <div class="control-group">
        @Html.LabelFor(x => x.EmailAddress, "Email", new { @class = "control-label" })
        <div class="controls">
            @Html.TextBoxFor(x => x.EmailAddress, new { @class = "input-xlarge", placeholder = "Enter an email address" })
            @Html.HelpMessageFor(x => x.EmailAddress, "Optional")
        </div>
    </div>
</fieldset>



European HostForLIFE.eu Proudly Launches WordPress 4.0 Hosting

clock September 1, 2014 09:14 by author Peter

HostForLIFE.eu proudly launches the support of WordPress 4.0 on all our newest Windows Server environment. On WordPress 4.0 hosted by HostForLIFE.eu, you can try our new and improved features that deliver extremely high levels of uptime and continuous site availability start from €3.00/month.

WordPress is a flexible platform which helps to create your new websites with the CMS (content management system). There are lots of benefits in using the WordPress blogging platform like quick installation, self updating, open source platform, lots of plug-ins on the database and more options for website themes and the latest version is 4.0 with lots of awesome features.

WordPress 4.0 was released in August 2014, which introduces a brand new, completely updated admin design: further improvements to the editor scrolling experience, especially when it comes to the second column of boxes, better handling of small screens in the media library modals, A separate bulk selection mode for the media library grid view, visual tweaks to plugin details and customizer panels and Improvements to the installation language selector.

HostForLIFE.eu is a popular online WordPress 4.0 hosting service provider catering to those people who face such issues. The company has managed to build a strong client base in a very short period of time. It is known for offering ultra-fast, fully-managed and secured services in the competitive market.

Another wonderful feature of WordPress 4.0 is that it uses vector-based icons in the admin dashboard. This eliminates the need for pixel-based icons. With vector-based icons, the admin dashboard loads faster and the icons look sharper. No matter what device you use, whether it’s a smartphone, tablet, or a laptop computer, the icons actually scale to fit your screen.

WordPress 4.0 is a great platform to build your web presence with. HostForLIFE.eu can help customize any web software that company wishes to utilize. Further information and the full range of features WordPress 4.0 Hosting can be viewed here http://hostforlife.eu/European-WordPress-4-Hosting

About Company
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.



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