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 3 Hosting :: Remote Validation in ASP.NET MVC 3 RC1

clock June 22, 2011 06:35 by author Scott

Remote validation has finally landed in RC1 of ASP.NET MVC 3.  It’s a weird area as more often than not people tend to over complicate something that is really pretty simple.  Thankfully the MVC implementation is fairly straightforward by simply providing wiring allowing the jQuery Validation plugin to work it's magic.  Basically there is a new Remote attribute that can be used like so.

public class Credentials
{   
    [Remote("Username", "Validation")]
    public string Username { get; set; }    

    public string Password { get; set; }
}

As you can see we have attributed the Username field with a Remote attribute.  The 2 parameters tell us what Action and Controller we should call to perform the validation.  This does make me feel slightly uneasy as it kind of feels like you are coupling the controller to the model which doesn't sit right by me.  currently sitting on the fence I'll see how it works in real life.  Anyway I implemented it like so,

public class ValidationController : Controller
{    public ActionResult Username(string UserName)
    {
        return Json(Repository.UserExists(Username), JsonRequestBehavior.AllowGet);
    }
}

And thats you - provided you have the necessary client side libraries included of course (jQuery, jQuery Validate etc). and have Client Side Validation turned on (now by default in MVC3).


Configuration

The Remote attribute offers a few nice little configuration options to make things easier.  The typical ones are there such as ErrorMessage, ErrorResource etc. but there are a few specific ones as well.

Fields

There may be a case where ding the name and the value of a single form field isn’t enough to perform validation.  Perhaps validation is affected by some other field/value in the form.  The Remote attribute accepts a comma separated list of other fields that need to be sent up with the request using the Fields parameter

This basic example will send up the value of the EmailService input field along with the value of Username.  Clean and simple.

[Remote("Username", "Validation", Fields = "EmailService")]

HttpMethod

HttpMethod simply allows us to change how the ajax request is sent e.g. via POST or GET or anything else that makes sense.  So to send a remote request via POST

[Remote("Username", "Validation", HttpMethod = "POST")]

A Minor Difference

You might notice if you read the release notes for RC1 that my implementation of the controller is slightly different.  The reason being that the example in the release notes is broken :-).  The example looks like this

public class UsersController {
    public bool UserNameAvailable(string username) {
        return !MyRepository.UserNameExists(username);
    }
}

However the Validate plugin expects a JSON response which is fine on the surface but returning a boolean response to the client side results in a response body of False (notice the captial F) which in turn causes a parse error when the plugin performs JSON.parse.  My suggested solution is actually more inline with how most people would typically write an Ajax capable controller action anyway (though I am not happy with the JsonRequestBehaviour usage) but there are other ways but they aren’t pretty….

public class ValidationController : Controller
{       
    public string Username(string username)
    {
        return (!Repository.UserExists(Username)).ToString().ToLower();
    }
}

See?  Ugly and plain WRONG (but it will work).

Nice to see this feature finally landing as it can be useful in certain situations.



European ASP.NET MVC 3 Hosting :: Error 0x80070643 When Install ASP.NET MVC 3, How to Fix It?

clock June 9, 2011 05:00 by author Scott

Have you ever get this error message when you installed your ASP.NET MVC 3?



This is the steps that I took to fix it:

1. Remove the trailing backslash from the following registry keys:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\ASP.NET\4.0.30319.0\Path

HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\ASP.NET\4.0.30319.0\Path

2. Uninstalled the old version of "Microsoft ASP.NET Web Pages".

3. Add the trailing backslash back to those keys.

4. Install MVC 3.



Good luck!!



European ASP.NET MVC 3 Hosting :: Get Selected Row from ASP.NET MVC 3 WebGrid

clock June 2, 2011 06:00 by author Scott

Every website has to display data and every website has a Grid control. In ASP.NET MVC 3 there’s the WebGrid, which is part of the Microsoft Web Helpers library. This can be downloaded through NuGet (formerly NuPack). NuGet is a free open source package manager that makes it easy for you to find, install, and use .NET libraries in your projects. One piece of functionality that is critical is reacting when the user selects an item in the WebGrid. This article will focus on finding out which row was selected, but also how to find out more about the data that is selected.

Before moving on, you need to download ASP.NET MVC 3.
Click here to download and install them using the Microsoft Web Platform Installer.

Open studio 2010 and create a new ASP.NET MVC 3 Web Application (Razor) project. To focus on the answer, I’ve got a simple model as seen below.



Using the WebGrid, it’s easy to display this data to the user.



The first column is the key to making this work. @item.GetSelectLink outputs a HTML anchor tag with the row selected. This is passed as a
QueryString, and the name of the QueryString is set by the selectionFieldName property set on the grid.



To find out what row is selected is just as easy. The WebGrid has a property called
SelectedRow. This sets a reference to a GridViewRow object that represents the selected row in the control. When you combine this with the HasSelection property, you can get the selected row like this.



I’ve created a partial view called _Person.cshtml. The file begins with an underscore (_) because I don’t want this file called directly from the web. The second parameter is the data being passed into the partial view. The data in this instance is the selected row.



Very easy, right??



European ASP.NET MVC 3 Hosting :: Scaffolding with the Repository Pattern in ASP.NET MVC 3

clock May 27, 2011 07:17 by author Scott

In this post I’m going to show you how to use MvcScaffolding to add a new controller template to enable scaffolding with data access code that uses the Repository Pattern.

One of the new features is built in tooling support for scaffolding. The “Add Controller” Dialog box has been revamped to include a few new options.



As you can see there are much more options as compared to before. The scaffolding options are as follows:

- Template: Allow you to specificy what kind of controller you want to generate. Out of the box you get an empty controller (Just a class with no actions), Controller with actions and views using the Entity Framework code first, and controller with empty read/write actions.
- Model: This is the object that will be used for scaffolding strongly typed views, CRUD actions and data access.
- DataContext: By default this is an EF Code First class that inherits from DbContext. You can either select an existing context or have the scaffolding tools create a new one for you.
- Views: Select between ASPX and Razor. This is pretty much the same as the “Add New View” dialog box.

Advanced Options include layout/master page settings and View script settings. Again, stuff that is also in the “Add New View” Dialog.



Scaffolding using the “Controller with read/write actions and views, using Entity Framework” is especially cool because it generates a controller, all associated views AND data access code for you. That’s right, all you need to do is create an model class and the scaffolder does the rest. How’s that for a productivity boost?


To test this I created a simple Product class which is defined as the following:

public class Product{
public int ProductId { get; set; }
public string Name { get; set; }
public string Description { get; set; }
}

Then I added a new controller with the following options:



The new tooling support created a new controller, all associated views and the data access code. That’s really cool, but let’s take a look at the controller code.

private ProductContext db = new ProductContext();
 //
// GET: /Product/
 public ViewResult Index()
{
return View(db.Products.ToList());
}


By default the scaffolding tools use the ProductContext object directly in the Controller. Many people don’t like this coupling (myself included) and prefer to use
the Repository Pattern. This allows us to abstract away our data access code behind a repository, making it easier to work with and later modify, if need be.

Well the good news is that the add controller dialog is extensible. You can add your own controller templates to enable data access using any technology mechanism you want.

I’m going to show you a way to get a repository option for EntityFramework to show up with very little work. All you need to do is install the MvcScaffolding NuGet Package.

Open the Package Manager Console and enter “Install-Package MvcScaffolding”:



Now right click on the controllers folder and select “Add”->”Controller”. We’re going to re-scaffold out our ProductController, associated views and data access code (WARNING: This will overwrite any changes you have made so be careful.)

Now take a look at the templates section and you should see new templates:



The last option let’s you scaffold out the entire thing and use repositories for data access. Go ahead and click “Add”. Check the checkboxes to allow the scaffolder to override existing items.

We can verify this by looking at our ProductController and we should see the following:

private readonly IProductRepository productRepository;

// If you are using Dependency Injection, you can delete the following constructor
public ProductController() : this(new ProductRepository()) { }
 public ProductController(IProductRepository productRepository) {
this.productRepository = productRepository;
}

//
// GET: /Product/
 public ViewResult Index(){
return View(productRepository.All);
}

Now the controller uses a repository instead of hard coding in the data access code. The repository itself uses EF Code First to do all the data access.



HostForLife.eu Proudly Launches Premier European SQL 2008 R2 Hosting

clock May 24, 2011 06:27 by author Scott

HostForLIFE.eu was established to cater to an under served market in the hosting industry; web hosting for customers who want excellent service. HostForLIFE.eu – a cheap, constant uptime, excellent customer service, quality, and also reliable hosting provider in advanced Windows and ASP.NET technology. We proudly announces the availability of the SQL 2008 R2 hosting in our entire servers environment. HostForlife customers have a choice between SQL Server 2008 and SQL 2008 R2 when creating a database from inside the HostForLife hosting control panel.

SQL Server 2008 R2 delivers several breakthrough capabilities that will enable your organization to scale database operations with confidence, improve IT and developer efficiency, and enable highly scalable and well managed Business Intelligence on a self-service basis for your users. For more information on SQL Server 2008 R2, visit the Microsoft website, http://www.microsoft.com/sqlserver/en/us/default.aspx.

Some of the capabilities that customers and partners will benefit from include:

1. PowerPivot: a managed self-service analysis solution that empowers end users to access, analyze and share data across the enterprise in an IT managed environment using Excel 2010 and SharePoint Sever 2010.
2. Master Data Services: helps IT organizations centrally manage critical data assets companywide and across diverse systems, and enables more people to securely manage master data directly, and ensure the integrity of information over time.
3. Application and Multi-server Management: helps organizations proactively manage database environments efficiently at scale through centralized visibility into resource utilization and streamlined consolidation and upgrade initiatives across the application lifecycle.
4. Report Builder 3.0: report authoring component with support for geospatial visualization. This new release provides capabilities to further increase end user productivity with enhanced wizards, more powerful visualizations, and intuitive authoring.
5. StreamInsight: a low latency complex event processing platform to help IT monitor, analyze and act on the data in motion to make more informed business decisions in near real-time.

For more information about this new product, please visit our site http://hostforlife.eu/SQL-2008-R2-European-Hosting.aspx.

About HostForLife

As a leading small to mid-sized business web hosting provider, we strive to offer the most technologically advanced hosting solutions available to our customers across the world. Security, reliability, and performance are at the core of our hosting operations to ensure each site and/or application hosted on our servers is highly secured and performs at optimum level. Unlike other web hosting companies, we do not overload our servers.



European ASP.NET MVC 3 Hosting :: Scaffold your ASP.NET MVC 3 project with the MvcScaffolding package

clock May 19, 2011 08:24 by author Scott

Hello, today we will give brief explanation about how to Scaffold your ASP.NET MVC 3 project with the MvcScaffolding package. Before we move on, I have good information for all of you. We have supported the latest ASP.NET MVC 3. We are the one of the most providers that support ASP.NET MVC 3 in Europe. To preview this new product, please visit http://hostforlife.eu/ASPNET-MVC-3-European-Hosting.aspx. If you have further question about our new product, please contact us at here.

Back to this tutorial, let’s start it:

1. Install ASP.NET MVC 3, which includes the excellent NuGet Package Manager.
2. Create or open an ASP.NET MVC 3 web application. I’m calling mine ‘SoccerSite’.
3. Install the MvcScaffolding package. You can install it using the NuGet Package Manager Console, so it only takes a few seconds and you don’t have to download anything using your browser.  To do so,

- Open the Package Manager Console window using Visual Studio’s View->Other Windows->Package Manager Console menu item.
- Enter the following:

Install-Package MvcScaffolding



- That’s it! Note: be sure you installed MvcScaffolding, not MvcScaffold. We’ll retire the old MvcScaffold package shortly.

In case you’re wondering, EFCodeFirst is the new super-elegant version of Entity Framework that persists plain .NET objects to a relational database without any configuration fuss, T4Scaffolding is the core scaffolding infrastructure (locates types in your project, finds scaffolders in other packages, renders templates, etc), and MvcScaffolding is a set of ASP.NET MVC-specific templates (for controllers and views) that bolts onto the T4Scaffolding core.

Scaffolding a CRUD interface

Let’s create a model for a soccer team. Add the following class to your Models folder, then compile your solution (Ctrl-Shift-B):

namespace
SoccerSite.Models
{
    public class Team
    {
        public int TeamId { get; set; }
        [Required] public string Name { get; set; }
        public string City { get; set; }
        public DateTime Founded { get; set; }
    }
}

Next, we can create a complete Create-Read-Update-Delete (CRUD) UI for this model by issuing a single scaffolding command into the Package Manager Console:

Scaffold Controller Team

Note: You can use the TAB key to autocomplete many things in the Package Manager Console. In this case, you can autocomplete the words “Scaffold” and “Controller”, since the scaffolding package knows about them. It doesn’t know about “Team”, though – we may add completion on model type names in a future version.



As you can see, it’s gone ahead and created a controller, a database context (a tiny bit of Entity Framework code that represents a data store), and views for all the CRUD actions. You can run it right now (Shift-F5), and as long as you have SQL Server Express running on your machine, EFCodeFirst will automatically connect to it, create your database schema, and you’ve got a basic working application without writing a single line of procedural code.

Note that since the model was called “Team”, the controller is called “TeamController”, so to reach it you need to point your browser to
http://…/team:



The database is initially empty.



Creating an item. Validation rules are applied automatically. Note that since “Founded” is a DateTime it can’t be null and hence is required. Change it to DateTime? (i.e., with the question mark to make it nullable) if you want it to be optional.



Listing Items



Deleting an item

But what if I don’t have SQL Express installed?

If you don’t have SQL Express installed and running, you may have got the following error when your code tried to read or write some data:

A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Blah blah blah…

No problem! You can quickly switch to use the new SQL Server Compact – a lightweight, in-process database – without having to download or install anything manually. Simply add SQL Server Compact to your project by issuing the following command in the Package Manager Console:

Install-Package EFCodeFirst.SqlServerCompact

Ta da – no more external database required. Run your project again (Shift-F5) and this time it will create and connect to a file-based database (a .sdf file will appear in your ~/App_Data folder). The EFCodeFirst.SqlServerCompact package adds a file to your project called AppStart_SQLCEEntityFramework.cs, which configures the runtime to use SQL CE.


Of course you probably still want the proper version of SQL Server when you eventually deploy your application for public use, but for small applications or for learning, SQL CE is really handy.

Scaffolding a repository

If you check out the code right now, you’ll see that TeamController reads and writes the data in SoccerSiteContext directly. That’s fine in many simple scenarios, but if you want to decouple your controller logic from persistence logic a little (e.g., so that you can write clean unit tests for the controller), you may prefer to reach your data through an interface.

No problem! Let’s regenerate the controller with the –Repository flag:

Scaffold Controller Team –Repository –Force

Notice that we also need to say –Force, otherwise the scaffolder won’t overwrite the files you already have in your project. Now the scaffolder will produce an additional class, TeamRepository, and the following interface which TeamRepository implements:

    public interface ITeamRepository
    {
        void Add(Team post);
        void Delete(int id);
        IEnumerable<Team> GetAllTeams();
        Team GetById(int id);
        void Save();
    }

TeamController will now only read and write data using ITeamRepository. If you’re new to ASP.NET MVC it may not be obvious why this is desirable, but if you start trying to write unit tests or switch data access technologies, you’ll find this interface-based data access method to be much cleaner and more flexible.

There’s so much more

It’s not just about CRUD! You can use scaffolding to create any type of project item if you write a template for it. This blog post has covered only the absolute beginning of what you can do, so over the coming days I’ll write blog posts to cover:

- Scaffolding specific individual items (e.g., views, repositories, etc) rather than whole controllers and related files
- Getting additional scaffolder packages and controlling which ones are used by default. For example, there’s currently a proof-of-concept LINQ to SQL scaffolding package that you can install and set to act as the default type of repository/data context.
- Customising the T4 templates that the scaffolders use to generate code
- Creating entirely new custom scaffolders for new types of things (e.g., unit test fixtures)



European ASP.NET MVC 3 Hosting :: Working with ServiceLocator in ASP.NET MVC 3.0

clock May 4, 2011 06:44 by author Scott

What is Common Service Locator?Today we have many Inversion of Control/Dependency Injection Containers like NInject,StructureMap,Unity,.. etc in the .NET world.Most of these vary quite widely in terms of configuration and initialization/registration of the instances.But they provide more or less similar interface while resolving the dependencies and returning object instances.Common Service Locator framework extracts these commonalities out and provides an abstraction on top of these IoC/DI containers.This is now part of the Enterprise Library 5.0 and used in the Enterprise Library code to create/retrieve objects.Common Service Locator provides an interface IServiceLocator.



It is quite evident from the method signatures that these are only related to retrieval of right object instances with proper resolution of the dependencies based upon different parameters.

Another important class related to the Common Service Locator is the ActivationException which needs to be thrown whenever there is exception in instantiating the objects /resolving the dependencies.

We were planning to use StructureMap as the DI Container and a StructureMap Adapter for Service Locator was available in Codeplex but that seemed far from complete.

So we went ahead to write few lines of code and develop a service locator which will use StructureMap as the DI container as shown below:



This class accepts an instance of the StructureMap.Container in the constructor and uses it to resolve dependencies and instantiate objects.In the implementation of the IServiceLocator methods we have to just map them suitably to StructureMap.Container.GetAllInstances and StructureMap.Container.GetInstance methods (and their overloads).The code which depends on IServiceLocator will perform exception handling based on ActivationException class whereas StructureMap raises StructureMap.StructureMapException in most of the cases.So we need to catch StructureMapException in this class and throw a ActivationException.The complete code is given below:



So we have our Service Locator class ready.



European ASP.NET MVC 3 Hosting :: Working with ASP.Net MVC 3 Razor View Engine and Syntax Highlighting

clock May 3, 2011 09:19 by author Scott

Today, we found a good answer on syntax highlighting for Razor. In the Visual Studio Gallery located at http://visualstudiogallery.msdn.microsoft.com/en-us/8dc77b9c-7c83-4392-9c46-fd15f3927a2e, a new Visual Studio extension has been recently added for a “Razor Syntax Highlighter”.

To leverage this new extension, we had to remove the editor mapping for .cshtml files in the Visual Studio Text Editor/File Extensions window and install the highlighter extension. As you see in the figure below, it worked great. This new extension uses the Razor Parser libraries to appropriately highlight the Razor code.



Unfortunately, this feature is offered as a Visual Studio Extension and hence is only available for paid-for Visual Studio 2010 editions.

Looking at the Razor Syntax, one can summarize it as a means to short-hand the <%= %> used in ASPX pages to designate code sections. For Razor, only a simple @ sign is used in-place of that bulky aforementioned code markup . Additionally, the Razor parser introduces helpful intelligence that makes the syntax even more user-friendly. For instance the following is a code block you would see in an ASPX page:

<%=if(true){%>
       <input value=”istrue”/>
<%}%>  

The corresponding Razor block for this snippet would be:


@if(true){
       <input value=”istrue”/>
}

The Razor syntax has simply “inferred” that the code will have a closing curly bracket without us having to apply any special markup tags to it. This further reduces the markup needed to accomplish the same task.

An important difference between Razor and ASPX View Engines is the absence of master pages for the earlier. Razor simply provides a _ViewStart.cshtml to bootstrap our application layout.

@{
    Layout = “~/Views/Shared/_Layout.cshtml”;
}

Latest Razor Beta does however support Partial rendering (RenderPartial) to explicitly render a Partial View as well as calling @RenderBody() which loads the actual view content to be served.

Now,
HostForLife.eu has supported ASP.NET MVC 3 hosting. For more information about this new product, please visit here.



European ASP.NET MVC 3 Hosting :: 5 Ways to Improve Your ASP.NET MVC Pages With Help From jQuery UI

clock April 28, 2011 10:43 by author Scott

Introduction to ASP.NET MVC

ASP.NET MVC (Model-View-Controller) provides a light-weight framework with a lot of flexibility over the base ASP.NET framework. Unfortunately, this means we lose most of the high-level control structure provided by ASP.NET. This isn't necessarily a bad thing when you consider where web appplications are today. The focus has shifted to provide better and more unique user-interfaces. Thus MVC is the perfect fit whereby we can generate very controlled markup and user navigation.

From this base we can carefully add components to the project as necessary to build web applications. Out of the box, MVC projects include several JavaScript libraries including jQuery-1.4.1.js, jQuery.validate.js, etc. One library which could bring a lot to your MVC project is jQuery UI. The jQuery UI library allows you to easily create high-level UI functions in JavaScript. Using jQuery + jQuery UI you are able to easily create some of those controls which are missing from MVC. Listed below are 5 ways in which you can use jQuery UI to improve your MVC projects.

1. Dialog/Popups


Creating popup windows within JavaScript is not an easy proposition when you need to factor in features such as modal/non-modal, moveable, etc. Within jQuery UI all popups are known collectively as a dialog. When using dialogs there are a couple common usages such as displaying a static popup message, displaying a popup add/edit screens. Often add/edit dialogs, such as those used on grids are quite complex as it requires a call to the server before displaying the dialog. With a the help of a Partial View and the jQuery UI dialog it is quite simple as shown below.

First we need a DIV element which we will use to house the content for the popup. For our purpose here we can can just create a DIV with the id of EditDialogDiv. Then we need to create a javascript method to retrieve the contents for the dialog, open the popup and to close the popup. These two javascript methods are listed below.

  <script type="text/javascript">
  function GetEditDialog()
  {
     var lnk = '<%= Url.Action("EditDialog") %>'; 

     $.ajax({
        url: lnk,
        success: function (data) {
          //Set the Dialog Contents
          $('#EditDialogDiv').html(data); 

          //Initialize and show the Dialog
          $('#EditDialogDiv').dialog();
          $('#EditDialogDiv').dialog({ title: 'Dialog Title', resizable: true, modal: false });
          $('#EditDialogDiv').dialog('open');
        }
     });
  } 

  function EditDialogComplete()
  {
     $('#EditDialogDiv').dialog('close');
  }
  </script>

The first method GetEditDialog uses a jQuery Ajax request to grab the contents of a PartialView returned from a Controller method. Once the Ajax call has the contents it replaces the EditDialogDiv with the data returned. Then the method initializes the jQuery Dialog and opens it. The second method EditDialogComplete will be called from within the dialog and is used to close it. Now that we have the JavaScript needed to open and close the Dialog, we need to look at how to trigger these. The open is simple enough, call GetEditDialog()  on an a button or link. To understand the close we need to look at the markup within the partial view used for the contents of the edit dialog. The partial view is shown below:

  <% using (Ajax.BeginForm("EditDialogSave", new AjaxOptions { UpdateTargetId = "EditDialogDiv", OnComplete = "EditDialogComplete" }))
  { %>
     Partial Edit Dialog
     <br />
     <input type="submit" value="Save" />
  <% } %>


This partial view is using the Ajax.BeginForm instead of the Html.BeginForm which allows us to asynchronously postback the contents of the form. Upon completion of the call, it will call the EditDialogComplete JavaScript method which will close the dialog. While a simple example it should illustrate how easy it is to make use of the jQuery Dialog an create Add/Edit dialogs which has been traditionally a very complex operation.

2. The Missing Date Picker

A date picker is a complex component to build yourself in JavaScript, luckily jQuery UI includes an effective Date Picker. To create a DatePicker we first need a text input box and a call upon document ready to initialize it as shown below:

 
<input id="DatePicker" type="text" /> 

  <script type="text/javascript">
  $(document).ready(function ()
  {
     $('#DatePicker').datepicker();
  });
  </script>

As you can see this simple snippet is all you need to start a Date Picker. When the user clicks on the DatePicker input box the calendar will be displayed and allow the user to choose a date.

3. Simple Autocomplete

The autocomple provided with jQuery UI allows for very easy integration with MVC. We start by creating an input box and a call upon document ready to setup the Auto Complete as shown below:

  <input id="AutoComplete" type="text" /> 

  <script type="text/javascript" >
  $(document).ready(function()
  {
     $('#AutoComplete').autocomplete({
          minLength: 2,
          source: '<%= Url.Action("AutoComplete") %>'
     });
  }
  </script>

The AutoComplete method within the Controller will receive a QueryString item of the name of the term. The method will need to return a JsonResult with a list made records each with an id, label and value.

4. Prebuilt Themes and Style Builder

When using many 3rd party tools we are often forced to use the built-in styles or go down the path of modifying the included CSS. Modifying CSS files for 3rd party tools can be extremely time consuming, especially if the documentation is lacking. jQuery UI is completely backwards to many other 3rd party controls. The jQuery UI website provides a suite of themes as well as a tool called Theme Roller which allows users to create and edit themes. This allows you to start from scratch or start with one of the similar themes and create the one that matches your site. This can be a huge time saver and drastically reduce the amount of time it takes to utilize jQuery UI within your site.

5. Better User Interactions With the Tabs, Accordion, Sortable Lists, additional Effects, etc.

jQuery UI also includes several elements which primarily serve to improve user interaction. The Tabs and Accordion elements are both useful in user navigation in that they allow you to embed more content on the page without using up more screen real estate. One important note about Tabs is that the content for each Tab can be fetched asynchronously allowing for you to use a Controller Action and a Partial View as a Tab. Another useful control is the Sortable or Sortable List which enables you to take a group of elements and allow the user to reorder them as needed. jQuery UI also includes other controls which can be useful such as a Slider and simple Progress Bar. Also included are additional animation effects similar to those included with jQuery.

Conclusion

Traditional ASP.NET is a bit of a challenge to take full advantage of jQuery UI due to the high-level nature of the platform. Since MVC and its low-level nature you are able to take advantage of jQuery UI without a lot of effort. With the flexibility provided by MVC, you to pull in and utilize just about any JavaScript library, jQuery UI is particularly attractiven given that MVC works so well with jQuery. Similar to jQuery, jQuery UI is also a very small library dispite the number of features packed in. Not to mention the documentation and tools provided for jQuery UI.

Top Reasons to host your ASP.NET MVC Website with HostForLife.eu

There are many reasons why so many people choose HostForLife over any other web hosting provider each year. Whether you’re beginner or an experience webmaster, HostForLife offers the perfect solution for everyone.

You’ll have highly trained, skilled professional technical support people ready, willing, and wanting to help you 24 hours a day. Your web hosting account servers are monitored from three monitoring points, with two alert points, every minute, 24 hours a day, 7 days a week, 365 days a year. The followings are the list of other added-benefits you can find when hosting with us:

1. World-class 24x7 Customer Support
Will your hosting company promptly answer questions and resolve issues - at 3 am on a Sunday? Even some providers claiming “24x7” support will not - but HostForLife will. Our outstanding uptime is backed by true 24x7 customer support. An expertly trained technician will respond to your query within one hour, round the clock. You will also get qualified answers. Other hosting companies typically have very low - level support staff during the night or weekends. HostForLife always has knowledgeable, top - level  support standing by, day or night, to give you the answers you need.

2. Commitment to Outstanding Reliability
Reliability, Stability, and Performance of our servers remain out TOP priority. Even our basic service plans are equipped with standard service level agreements for 99.99% uptime. Advanced options raise the bar to 99.99%. Our state-of-the-art data centers combine servers and SAN storage with full redundancy and operational tools with proprietary service management techniques. Full backup and recovery capabilities are implemented, including redundant power supplies, cooling and connectionsto major data networks.

3. “Right-size” plans for maximum value
HostForLife offers a complete menu of services. IT professionals select only what they need - and leave behind what they don’t. The result is an optimal blend of cost and performance. We offer IT professionals more advanced features and the latest technology - ahead of other hosting companies.

4. Profitable, Stable, Debt-free Business
Financial stability is the bedrock of a hosting provider’s ability to deliver outstanding uptime, cost-effective service plans and world-class 24x7 support.  HostForLife’s customers are assured of our financial integrity and stability - a stark contrast to the ups and downs they may have experienced with other providers.

5. The Best Account Management Tools
HostForLife revolutionized hosting with Plesk Control Panel, a Web-based interfaces that provides customers with 24x7 access to their server and site configuration tools. Some other hosting providers manually execute configuration requests, which can take days. Plesk completes requests in second. It is included free with each hosting account. Renowned for its comprehensive functionally - beyond other hosting control panels - and ease of use, Plesk Control Panel is available only to HostForLife’s customers.

6. 30-Day Money Back Guarantee
HostForLife 30 day money back guarantee ensures you have the ability to cancel your account anytime within your first 30 days under our full 30 day money back guarantee (less one-time account setup free). So what are you waiting for? Sign up today, risk free…

7. Simplicity with FREE 1-Click Installation

HostForLife was designed with ease of use in mind. From one click installations of your favourite website applications to our much talked about drag and drop website builder, you can rest assure your stay with us is going to be a smooth one. HostForLife offers the most extensive set of scripts on the web allowing you to build complicated websites with little or no programming knowledge at all. From blogs to forums to powerful e-commerce solutions, Super Green has something that is right for you.



ASP Net MVC European Hosting :: ASP.NET MVC Request Validation

clock May 12, 2010 07:44 by author Scott

This topic contains information about key features and improvements in the .NET MVC . This topic does not provide comprehensive information about all new features and is subject to change. In case you are looking for ASP.NET MVC Hosting, you can always consider HostForLife.eu and you can start from our lowest Standard Plan € 3.00/month to host your ASP.NET MVC site.

When using ASP.NET MVC to post data that might contain HTML or other potentially dangerous data, the default behavior as of the Release Candidate is to throw an exception, preventing the posting of the data.  This is a well-known feature of ASP.NET that was introduced several versions ago, and the typical way to avoid it (when necessary for the applications function) is to add validateRequest=false either to the @Page attribute or to the <pages /> section in web.config.  Notably, this doesnt actually work with ASP.NET MVC RC (and v1.0 I presume).

The reason for this is because of the way ASP.NET MVC processes requests.  In traditional web forms, the page itself is responsible for handling the request, but in MVC the controller has this responsibility.  The ASPX page in MVC is simply the view, and in fact a particular request might not even render a view, completely bypassing the Request Validation features of the Page.

Instead, request validation has been moved to the controller, which is where any logic for writing possibly dangerous data to the database would reside.  If it is necessary to bypass Request Validation in an ASP.NET MVC application, then the way to achieve it is with an attribute on the controller or action involved.

We were trying to add a post with an <img /> tag in it to test out one of the features of the blog.  Unfortunately, we initially got a request validation exception when we tried to post the content, and after adding validateRequest=false to the <pages /> section in web.config, the error persisted.  A little bit of research revealed the need to update the controller associated with the post (not the one used to render the Add view) with the ValidateInput(false) attribute, like so:

[ValidateInput(false)]
public ActionResult Create([Bind(Prefix=””)] Models.BlogEntry entry)
{

}

Top Reasons to host your ASP.NET MVC Website with HostForLife.eu

There are many reasons why so many people choose HostForLife over any other web hosting provider each year. Whether you’re beginner or an experience webmaster, HostForLife offers the perfect solution for everyone.

You’ll have highly trained, skilled professional technical support people ready, willing, and wanting to help you 24 hours a day. Your web hosting account servers are monitored from three monitoring points, with two alert points, every minute, 24 hours a day, 7 days a week, 365 days a year. The followings are the list of other added-benefits you can find when hosting with us:

1. World-class 24x7 Customer Support
Will your hosting company promptly answer questions and resolve issues - at 3 am on a Sunday? Even some providers claiming “24x7” support will not - but HostForLife will. Our outstanding uptime is backed by true 24x7 customer support. An expertly trained technician will respond to your query within one hour, round the clock. You will also get qualified answers. Other hosting companies typically have very low - level support staff during the night or weekends. HostForLife always has knowledgeable, top - level  support standing by, day or night, to give you the answers you need.

2. Commitment to Outstanding Reliability
Reliability, Stability, and Performance of our servers remain out TOP priority. Even our basic service plans are equipped with standard service level agreements for 99.99% uptime. Advanced options raise the bar to 99.99%. Our state-of-the-art data centers combine servers and SAN storage with full redundancy and operational tools with proprietary service management techniques. Full backup and recovery capabilities are implemented, including redundant power supplies, cooling and connectionsto major data networks.

3. “Right-size” plans for maximum value
HostForLife offers a complete menu of services. IT professionals select only what they need - and leave behind what they don’t. The result is an optimal blend of cost and performance. We offer IT professionals more advanced features and the latest technology - ahead of other hosting companies.

4. Profitable, Stable, Debt-free Business
Financial stability is the bedrock of a hosting provider’s ability to deliver outstanding uptime, cost-effective service plans and world-class 24x7 support.  HostForLife’s customers are assured of our financial integrity and stability - a stark contrast to the ups and downs they may have experienced with other providers.

5. The Best Account Management Tools
HostForLife revolutionized hosting with Plesk Control Panel, a Web-based interfaces that provides customers with 24x7 access to their server and site configuration tools. Some other hosting providers manually execute configuration requests, which can take days. Plesk completes requests in second. It is included free with each hosting account. Renowned for its comprehensive functionally - beyond other hosting control panels - and ease of use, Plesk Control Panel is available only to HostForLife’s customers.

6. 30-Day Money Back Guarantee
HostForLife 30 day money back guarantee ensures you have the ability to cancel your account anytime within your first 30 days under our full 30 day money back guarantee (less one-time account setup free). So what are you waiting for? Sign up today, risk free…

7. Simplicity with FREE 1-Click Installation
HostForLife was designed with ease of use in mind. From one click installations of your favourite website applications to our much talked about drag and drop website builder, you can rest assure your stay with us is going to be a smooth one. HostForLife offers the most extensive set of scripts on the web allowing you to build complicated websites with little or no programming knowledge at all. From blogs to forums to powerful e-commerce solutions, Super Green has something that is right for you.

 



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