ASPHostPortal As The Best ASP.NET Hosting Provider

ASPHostPortal As The Best ASP.NET Hosting Provider

I had been looking for a suitable hosting provider for my website and, believe me, there are almost thousands of sites selling the same ASP for almost similar price and services. And of course, I never thought to find ‘the one’ from all of them without trying to read their ‘specification’ and sure their trusted offices. Finding a hosting provider does not seem as easy as it looks.

As the result, just for your information ASP.Net coming from an open – source server – side website application framework designed for web development to produce a dynamic web page. It is first released in 2002 and it allows programmer to build their own dynamic websites, web applications and web services. As a beginner front end developer, or just a newbie website programmer, I am trying to find the simplest and well known web hosting and trustable hosting provider to start with.

That is why I want to help you with my reviews about ASPHostportal ASP.NET core hosting and I hope it would be useful for anyone who just (like me) trying to find the best – fit web hosting and/or hosting provider which you can compare to another hosting provider. Also for their pros and cons based on my experience as a paying costumer.

As one of the most well – known web hosting, finding user reviews about the ASPHostPortal wouldn’t be such a difficulty. Some of them even (specifically) starting to explain with details almost on every side of the product itself. I am not going to go that far by the way (especially because it is just a review) and just sharing my perception about the web hosting by their services, speeds, performances, up time and soon.

  • Pricing and Plan Structure

Actually, compared to any other hosting provider with their own monthly payment prices, ASPHostPortal might give you the cheapest price for their ASP web hosting services. I have been looking and comparing for the four (or more) ASP.Net provider and it is just shocked me that they sell it starting from almost only one dollar in a month. The ranges of prices are reasonable and I am not saying that the other hosting provider puts a higher price for the same products. They have almost similar in prices starting from 1 dollar up to 2 or 3 dollars for a month (not include renewable prices).

What makes them different is coming from bonuses, discount and renewal prices, but I can assure you that it does affordable. You might choose the best hosting provider by meticulously breakdown their true value into different parts like looking at their core hosting features or else.

Core hosting features are something called with the “3 D’s” – domains, databases and disk space, like specification besides of your chosen web hosting. They usually put the core hosting features right down below the prices as one of the marketing strategies which ease you to pick your favorable web hosting. The name ‘core’ purposed for your hosting server to served website files when someone types your domain names. Here’s your “3 D’s” consideration:

  1. Domains, about how many domain names you want from your hosting account with provided charge for each selection. If you need multiple websites you should also have multiple domain names.
  2. Databases are about how many, website software could be use and run on your hosting server.
  3. Disk space is just another how big data and files you could put on your server.

ASPHostPortal makes things much simpler by providing 2 of the most wanted ASP hosting server that is Windows and Linux (which I think it is most basically concentrated more in their Windows ASP). The difference is just about the number of hosting you might need and of course according to their features inside.

1 Giga bite disk space and 10 GB bandwidth for only a dollar in a month is something you should really try because I am not lying that ASPHostPortal is just not an ordinary hosting provider. It is trustable and they are professional workers for almost 11 years now.

  • Security, Reliability and Performance

As said that ASPHostPortal is one of the most recommended windows hosting in the world, I think it is quite good for some reasons. What I mean is, how fast your website would run and another trouble about buffering or else in performance is something you should know before choosing your own web hosting. Well, I have been running the ASPHostPortal and finding that their moderate yet stable speed is about 99.99% uptime (it is guaranteed) and it is of course high quality which the world (mostly) uptime standard is about 99%.

Well, I am not trying to call their service support at 12 o’clock in the midnight just to verify whether they truly have 24/7 support management or not. Just once, in the morning and the response is quite fast and problem solving so I think it is similar enough with thousand other reviewers, ASPHostPortal does have professional support and its 30 days guaranteed or your money back.

ASPHostPortal also provided by ‘reseller’ panels for anyone who wants to sell their already ‘management’ website and it is helpful because some other hosting provider doesn’t and also, together with its ‘take line’ by providing the best web hosting for the cheapest price, you can also buy 10 resellers website with 40 GB disk space and 200 GB bandwidth (a range of frequencies within a given band particularly used for transmitting a signal) for only 21 dollars in a month.

It is also known as the first of the class for its 12 servers in all countries around the world. For anyone who likes to spread their websites for all the best market place country in Europe, Asia and/or USA you really have to try one of these products. They manage to not –never overloaded their servers so that no one of their costumers would likely to fail in being protected (and believe me, I only found these interesting words in here and not everywhere else). They also equipped their servers an Intel Dual Processor Multi core with 8 GM RAM and 1000 Mbps connection backbone.

Well, some reviews almost all of them always saying that ASPHostPortal is easy, simple and cheap. It is most likely the best ASP.NET hosting provider for anyone who is an expert or just a newbie program developer.

Using multiple hosting environments on the same machine in ASP.NET Core

CheapASPNETHostingReview.com | Best and cheap ASP.NET Core hosting. This short post about how to set the hosting environment in ASP.NET Core.

However, if this is a capability you think you will need, you can use a similar approach to the one I use in that post to set the environment using command line arguments.

This approach involves building a new IConfiguration object, and passing that in to the WebHostBuilder on application startup. This lets you load configuration from any source, just as you would in your normal startup method, and pass that configuration to the WebHostBuilder using UseConfiguration. The WebHostBuilder will look for a key named "Environment" in this configuration, and use that as the environment.

For example, if you use the following configuration.

 You can pass any setting value with this setup, including the “environment variable”:

This is fine if you can use command line arguments like this, but what if you want to use environment variables? Again, the problem is that they’re shared between all apps on a machine.

However, you can use a similar approach, coupled with the UseEnvironment extension method, to set a different environment for each machine. This will override the ASPNETCORE_ENVIRONMENT value, if it exists, with the value you provide for this application alone. No other applications on the machine will be affected.

To test this out, I added the MYCOOLPROJECT_ENVIRONMENT key with a value of Staging to the launch.json file VS uses when running the app:

Running the app using F5, shows that we have correctly picked up the Staging value using our custom environment variable:

With this approach you can effectively have a per-app environment variable that you can use to configure the environment for an app individually.

Summary

On shared hosting, you may be in a situation when you want to use a different IHostingEnvironment for multiple apps on the same machine. You can achieve this with the approach outlined in this post, building an IConfiguration object and passing a key to WebHostBuilder.UseEnvironment extension method.

How To Implementing simple token authentication in ASP.NET Core with OpenIddict

How To Implementing simple token authentication in ASP.NET Core with OpenIddict

CheapASPNETHostingReview.com | Best and cheap ASP.NET Core 1.0 hosting. Good news! While the first OpenIddict alpha bits were tied to Identity, the two have been completely decoupled as part of OpenIddict beta1 and beta2. Concretely, this means you can now use OpenIddict with your own authentication method or your own membership stack.


Get started

Register the aspnet-contrib feed

Before coding, you’ll have to register the aspnet-contrib MyGet feed, where the preliminary OpenIddict beta bits are currently hosted. For that, create a new NuGet.config at the root of your solution:

Update your project.json to reference the OpenIddict packages

For this demo, you’ll need to reference 4 packages:

  • AspNet.Security.OAuth.Validation, that provides the authentication middleware needed to validate the access tokens issued by OpenIddict.
  • OpenIddict, that references the OpenID Connect server middleware and provides the logic required to validate token requests.
  • OpenIddict.EntityFrameworkCore, that contains the default EntityFramework stores.
  • OpenIddict.Mvc, that provides an ASP.NET Core MVC binder allowing to use OpenIdConnectRequest as an action parameter.

Add OpenIddict in the ASP.NET Core application

Register the OpenIddict services in the dependency injection container

Register OpenIddict and the validation middleware in the ASP.NET Core pipeline

Make sure to always register the validation middleware very early in your pipeline: if the validation middleware is not at the right place, requests won’t be correctly authenticated when reaching the next middleware (e.g MVC).

The same remark applies to OpenIddict, that must be inserted before MVC to validate token requests before they reach your own code. If you don’t register it correctly, an exception will be thrown at runtime.

Create your own token authentication controller

Create an API controller

Test your ASP.NET Core application

Retrieve an access token from your authentication controller

To retrieve an access token, send a POST request to /connect/token with the grant_type=password parameter and the user credentials:

token-request

If the credentials are valid, you’ll get a JSON response containing the access token:

Query your API controller using a bearer token

To send an authenticated request, simply attach the bearer token to the Authorization header using the following syntax: Authorization: Bearer [your bearer token] (without the square brackets)

api-request

If the access token is valid, you’ll get a JSON payload containing the user details returned by the API:

Claim Based Security on ASP.NET Core 1.0

Claim Based Security on ASP.NET Core 1.0

CheapASPNETHostingReview.com | Best and cheap ASP.NET Core 1.0 hosting. Even though the ASP.NET Web platform and ASP.NET project scaffold have undergone some significant changes, ASP.NET MVC Views and Controllers have faced rather minor transformation in comparison with the shift in skeleton of the Application with the new platform. So here’s a brief outline of the latest news in ASP.NET development.

In this article, I’m going to describe the main concepts of building claim-based security on top of a brand-new platform: ASP.NET Core (with .NET Core). At the same time, I will create an application with similar functionality (as was done in my previous article), highlighting the differences.

Let’s get down to work. Create a “Hello World” ASP.NET Core Web application using the .NET Core framework

Claims1

Figure 1: Creating a new ASP.NET Core Web application

Just like in the previous version of ASP.NET MVC, the main job is done. The default Visual Studio .NET Web Project template has already added all the namespaces and assemblies required for our test project. The only thing left is to implement simple functionality to add a new Claim during the user registration/creational process and then apply the authorization restriction to the user with the Claim specified.

Let’s quickly review the most important pieces of functionality responsible for security work this time:

Startup.cs is a class for the entire application bootstrap, including security:

Models\ApplicationUser.cs contains an ApplicationUser class that derives from Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityUser:

Until now, it’s been empty, so this is where we should add our claims. Let’s start applying code changes to demonstrate Claim-based security in real life:

1. Enable Entity Framework Migrations

Enable Entity Framework Migrations if there are any iterative changes to Claims planned. Because ASP.NET Identity uses Code First, auto-migration would be useful to perform database schema updates

2. Add Relevant Properties

Add all relevant properties to the ApplicationUser class (in file Models\ApplicationUser.cs) to store the Claims. Let’s take “BirthDate” and add this property to ApplicationUser. Don’t forget to add the using System clause before class definition.

3. Add EF Migration

Add EF migration to the update database with the new field. In the Package Manager Console, perform the following steps:

  1. Add-Migration “Age” <press Enter> to create an upgrade script for our modification.
  2. Update-Database <press Enter> to run a database schema update.

Now, we need to implement the filling out of the Birthday value. To make it more obvious, add a Birthday parameter to the User Registration form in the Models\AccountViewModels\RegisterViewModel.cs RegisterViewModel class:

4. Update the Views\Account\Register.cshtml File

Update the Views\Account\Register.cshtml file with the new field:

5. Update the Controllers\AccountController.cs Register Method

Update the Controllers\AccountController.cs Register method to pass Birthday:

6. Add the Claims

Now, we need to add the Claims. To be more precise, we need a mechanism to add the Claims in ASP.NET Core because Microsoft.AspNetCore.Identity.SignInManager<TUser>, by default, includes only username and user identifier claims. SignInManager<TUser> uses IUserClaimsPrincipalFactory<TUser> to generate ClaimsPrincipal from TUser (in our case, from ApplicationUser).

We need to create our own implementation of IUserClaimsPrincipalFactory<TUser> to add custom claims. To not generate the boilerplate code, simply derive it from the default UserClaimsPrincipalFactory<TUser> which is already implementing IUserClaimsPrincipalFactory<TUser>.

7. Register CustomClaimsPrincipalFactory

We need to register our CustomClaimsPrincipalFactory in Startup.cs after the Identity setup has been added:

8. Verify the Claim

We have implemented the Claims setup. The only thing left is to verify the Claim. It is a common practice to write custom Authorize filters to verify the availability and particular value of the Claim pair, and then put that filter on the controllers’ actions.

Claim BirthDay requires more checks, so I will implement verification of the Claim just for demonstration purposes in the Controllers\HomeController.cs About method:

Any Claim may be extracted easily from the HttpContext.User at any point of the project.

Traditionally, let’s try to verify if the code works.

Reviewing all the Claims (in debug window):

Claims4

Figure 4: Viewing the Claims in the debug window

Conclusion

That was a step-by-step guideline to set up Claim-based security in ASP.NET Core with the help of ASP.NET Core Identity.

Compared to the previous-generation ASP.NET MVC, at first glance implementation of the Claim-based security looks more complicated in ASP.NET Core. Previously, it was possible to add the Claims directly in the ApplicationUser implementation via overriding the GenerateUserIdentityAsync() method. In ASP.NET Core, we need to implement IUserClaimsPrincipalFactory<TUser> that is internally used by SignInManager<TUser>. On the other hand, we’ve got more structured classes and interfaces implementation in ASP.NET Core, as logically SignInManager should indeed control sign-in processes (including claims) and ApplicationUser should be just an IdentityUser.

One more useful thing that was introduced in ASP.NET Core is Claim-Based Authorization on top of Policies. It simplifies the verification of Claims on Controllers and Methods, thereby providing an ability to group the Claims.

How to Set Up Angular 2 and TypeScript in a ASP.NET Core Project Using Visual Studio

How to Set Up Angular 2 and TypeScript in a ASP.NET Core Project Using Visual Studio

CheapASPNETHostingReview.com | Best and cheap ASP.NET Core hosting. There are two ways to set up an Angular 2 application. The most preferred way is to use angular-cli, which is pretty simple. Unfortunately, the Angular CLI doesn’t use the latest version. The other way is to follow the tutorial on angular.io, which sets up a basic starting point, but this needs a lot of manual steps.

maxresdefault

There are also two ways to set up the way you want to develop your app with ASP.NET Core. One way is to separate the client app completely from the server part. It is pretty useful to decouple the server and the client to create almost independent applications and to host on different machines. The other way is to host the client app inside the server app. This is useful for small applications, having everything in one place, and it is easy to deploy on a single server.

In this post, I’m going to show you, how you can set up an Angular 2 app, which will be hosted inside an ASP.NET Core application using Visual Studio 2015. The Angular-CLI is not the right choice here because it already sets up a development environment for you and all that stuff is configured a little bit differently. The effort to move this to Visual Studio would be too much. I will almost follow the tutorial on http://angular.io/. But we need to change some small things to get that stuff working in Visual Studio 2015.

Configure the ASP.NET Core Project

Let’s start with a new ASP.NET Core project based on .NET Core. (The name doesn’t matter, so “WebApplication391” is fine). We need to choose a Web API project because the client side Angular 2 App will probably communicate with that API and we don’t need all the predefined MVC stuff.

A Web API project can’t serve static files like JavaScripts, CSS styles, images, or even HTML files. Therefore we need to add a reference to Microsoft.AspNetCore.StaticFiles in the project.json:

And in the startup.cs, we need to add the following line, just before the call of `UseMvc().

Another important thing we need to do in the startup.cs is to support the Routing of Angular 2. If the Browser calls a URL that doesn’t exist on the server, it could be an Angular route. Especially if the URL doesn’t contain a file extension.

This means we need to handle the 404 error, which will occur in such cases. We need to serve the index.html to the client if there was an 404 error on requests without extensions. To do this we just need a simple lambda based MiddleWare, just before we call UseStaticFiles():

Inside the properties folder, we’ll find a file called launchSettings.json. This file is used to configure the behavior of Visual Studio 2015, when we press F5 to run the application. Remove all strings “api/values” from this file, because Visual Studio will always call that specific Web API every time you press F5.

Now we prepared the ASP.NET Core application to start to follow the angular.io tutorial.

Let’s start with the NodeJS packages. Using Visual Studio we can create a new “npm Configuration file” called package.json. Just copy the stuff from the tutorial:

In this listing, I changed a few things:

  • I added “&& gulp restore” to the postinstall script.
  • I also added Gulp to the devDependency to typings.

After the file is saved, Visual Studio tries to load all the packages. This works, but VS shows a yellow exclamation point for errors. Until recently, I didn’t figure out what was going wrong here. To be sure all packages are propery installed, use the console, change directory to the current project, and type npm install

The post install will possibly fail because gulp is not yet configured. We need gulp to copy the dependencies to the right location inside the wwwroot folder, because static files will only be loaded from that location. This is not part of the tutorial on angular.io, but is needed to fit the client stuff into Visual Studio. Using Visual Studio we need to create a new “gulp Configuration file” with the name gulpfile.js:

The task restore copies all the needed files to the Folder ./wwwroot/libs

TypeScript needs some type definitions to get the types and API definitions of the libraries, which are not written in TypeScript or not available in TypeScript. To load this, we use another tool, called “typings.” This is already installed with NPM. This tool is a package manager for type definition files. We need to configure this tool with a typings.config

Now we have to configure TypeScript itself. We can also add a new item, using Visual Studio to create a TypeScript configuration file. I would suggest not to use the default content, but rather the contents from the angular.io tutorial.

The only things I did with this file were to add the “compileOnSave” flag and to exclude the “node_modules” folder from the TypeScript build, because we don’t need to build containing the TypeScript files and because we moved the needed JavaScript to ./wwwroot/libs.

If you use Git or any other source code repository, you should ignore the files generated out of our TypeScript files. In the case of Git, I simply add another .gitignore to the ./wwwroot/app folder.

We do this because the JavaScript files are only relevant to run the application and should be created automatically in the development environment or on a build server, before deploying the app.

The First App

That is all we need to prepare an ASP.NET Core project in Visual Studio 2015. Let’s start to create the Angular app. The first step is to create an index.html in the folder wwwroot:

As you can see, we load almost all JavaScript files from the libs folder. Except a systemjs.config.js. This file is needed to configure Angular2, to define which module is needed, where to find dependencies, and so on. Create a new JavaScript file, call it systemjs.config.js, and paste the following content into it:

This file also defines a main entry point which is a main.js. This file is the transpiled TypeScript file main.ts we need to create in the next step. The main.ts bootstraps our Angular 2 app:

We also need to create our first Angular2 component. Create a TypeScript file with the name app.component.ts inside the app folder:

Conclusion

I propose to use Visual Studio just for small single-page applications because it gets slower the more dynamic files need to be handled. ASP.NET Core is pretty cool to handle dynamically generated files, but Visual Studio still is not. VS tries to track and manage all the files inside the project, which slows down a lot. One solution is to disable source control in Visual Studio and use an external tool to manage the sources.

Another — even better — solution is not to use Visual Studio for front-end development. In a new project, I propose to separate front-end and back-end development and to use Visual Studio Code for the front-end development or even both. You need to learn a few things about NPM and Gulp, and you need to use a console in this case, but web development will be a lot faster and a lot more lightweight with this approach.