European ASP.NET 4.5 Hosting BLOG

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

Press Release – HostForLIFE.eu Proudly Announces SQL 2012 Hosting for European Market

clock April 23, 2012 07:40 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 2012 hosting in our entire servers environment. HostForLife customer can choose SQL 2012 when creating a database from inside HostForLife hosting control panel.

The first new option is Windows SQL Server 2012, which is available to customers from today. With the public release just last week of Microsoft’s latest version of their premier database product, HostForLife has been quick to respond with updated their shared server configurations. SQL Server 2012 Web Edition is available for the same low monthly rental price as the previous SQL 2008, as well as Express Edition, which is a basic version of Microsoft’s SQL Database product, available for free.


“We’re proud to be at the cutting edge for new technologies. With these additions, customers have the option to explore these new products in the safe environment of their own shared server. Developers and IT Managers can research the potential impact of next-generation software without risking current infrastructure. With Microsoft’s announcement of the general availability of their new SQL server, we are proud to launch SQL 2012 hosting along with a suite of SQL 2012 management tools." Said John Curtis, VP Marketing and Business Development at HostForLIFE.eu.


John added, “It’s very important to our customers that we support their current deployments; we want to make sure that our customers have their good opportunity to test this new technology."


“HostForLIFE customers can now take advantage of SQL Server 2012’s advanced BI capabilities, We’re excited to see the benefits of this release add value to the energy management and manufacturing arena. Ensuring compatibility with Microsoft’s new SQL Server 2012 demonstrates how HostForLife and Microsoft remain committed together to providing leading edge technology for the benefit of our shared customers." Said CEO of HostForLIFE.eu, Anthony Johnson.


For more information about this new product, please visit
http://www.hostforlife.eu/SQL-2012-European-Hosting.aspx.

About us:


We are European Windows Hosting Provider which FOCUS in Windows Platform ONLY. We support Microsoft technology, such as the latest ASP.NET 4, ASP.NET MVC 3, SQL 2008/2008 R2, and much more.


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


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

 



European ASP.NET 4.5 Hosting - Amsterdam :: Creating Web Applications with HTML5 WebSockets

clock April 16, 2012 11:05 by author Scott

WebSockets enables the real-time web where the information is available to the user the moment it is published. WebSockets are standard based, Interoperable across browsers and very simple to use. We got the WebSockets support everywhere it is available on browsers, windows run time, WCF, ASP, IIS etc. This post gives you the basic idea about WebSockets and the technicalities behind this concept.

There is a deep desire for speed to get the information as quickly as possible.


Typical examples where user wants to see the information in real time


- Stock Market data

- Live Scores
- Airline Location
- Twitter Search Results
- Interactive games

The Problem

HTTP is a state less protocol where server can communicate with client only once per request received. Real time web needs asynchronous communication with client.




In the above example when you are 7 letters of text and sending to the server , it actually sending the 4kb of data to the server. We can do better and it clearly tells us the HTTP is not adequate for the real-time web.


Solution

WebSocket – is an enabler of the real-time web. Sockets are full-duplex bi-directional protocol. These Sockets are not directly available to the developers. So we need richness of Sockets and reach of Web. All together called WebSockets.


WebSockets Characteristics

- Full duplex bidirectional communication
- Supports unsecure(TCP) and secure(HTTPS) channels
- It can traverse proxies and firewalls
- It keeps the connection alive



Step1:
You start the communication with HTTP and tells the server you want to do the communication using sockets.

Step2:
The server checks and accepts the request then it starts the socket communication. At this stage both of them drop-down to start communication using sockets.

How the protocol operates?

The request from client looks like as below




It basically saying it supports websocket communication. The security key in the header is to both side to understand the sockets.


The Response from the server looks like below




WebSocket API
it is defined in W3C Primary methods and events are as below



You have the call-back method if connection is opened or if you connection is closed or message is received.


The request URI in this communication looks as below




notice it has a special scheme name
WS , ws indicates to the browser this is not something that not goes through the wire and says it is web sockets request is coming on and you need to do the HTTP hand shake down before actual communication start. ws never goes on the wire, it is HTTP that goes on the wire.

Creating a WebSocket is simple




Sending a Text message using this socket




Capturing the server response in onmessage event as below




WebSockets is an emerging standard which enables secure, real-time , bi-directional communication across the web. Microsoft supporting this in IE10, Windows 8 Apps, IIS, ASP.NET and WCF.



European ASP.NET 4.5 Hosting - Amsterdam :: WebSockets in ASP.NET 4.5

clock March 23, 2012 05:49 by author Scott

This post discuss about using WebSockets in ASP.NET 4.5. You can read this post to get an understanding about WebSockets. This post shows piece of code which uses WebSockets in ASP.NET 4.5 and the code is related to simple chat application.

The HTML of Web Form chat application looks as below




It contains a text box where you can type your text message and button where it sends a message to the server. You can notice there is <ul> element which shows the list of other messages which are arriving from the server.


Instantiate a W3C WebSocket JavaScript object and pointed to url to establish a connection to WebSockets Server.




The url starts with ws which runs on HTTP and pointing to .ashx handler which runs on ASP.NET server.


The Chat Handler code looks as below, The handler code checks whether sender is looking for WebSockets connection.






AcceptWebSocketRequest is a new method on Context object in ASP.NET 4.5.


ChatHandler is a wrapper API which implements lower level of WebSockets Handler.


The ChatHandler code looks as below




Override the OnOpen method in ChatHandler Class as below




We are modifying the OnOpen method code by adding the set WebSockets collection variable which contains the set of connection objects.






chatapp exposes a method BroadCast which accepts string or binary payload and send the message to all the objects in the collection. The payload in this piece of code is a JSON object.




Now To handle the messages that coming from the server, we are adding below piece of code in JavaScript by implementing a handler for OnMessage.


<image>


In above code we are actually parsing the JSON object that coming from server using JSON.parse method.


To send a message from client to server you can use the below code




Once this message comes to the server, you can check the type of message and can write the code as below




There is a OnClose method which you can override to close your WebSockets connection. For example when user closes the browser this method will fire and closes the connection.




When you run the application then output is as below


 

 



European ASP.NET 4.5 Hosting - Amsterdam :: WebSockets in ASP.NET 4.5

clock March 23, 2012 05:49 by author Scott

This post discuss about using WebSockets in ASP.NET 4.5. You can read this post to get an understanding about WebSockets. This post shows piece of code which uses WebSockets in ASP.NET 4.5 and the code is related to simple chat application.

The HTML of Web Form chat application looks as below




It contains a text box where you can type your text message and button where it sends a message to the server. You can notice there is <ul> element which shows the list of other messages which are arriving from the server.


Instantiate a W3C WebSocket JavaScript object and pointed to url to establish a connection to WebSockets Server.




The url starts with ws which runs on HTTP and pointing to .ashx handler which runs on ASP.NET server.


The Chat Handler code looks as below, The handler code checks whether sender is looking for WebSockets connection.






AcceptWebSocketRequest is a new method on Context object in ASP.NET 4.5.


ChatHandler is a wrapper API which implements lower level of WebSockets Handler.


The ChatHandler code looks as below




Override the OnOpen method in ChatHandler Class as below




We are modifying the OnOpen method code by adding the set WebSockets collection variable which contains the set of connection objects.






chatapp exposes a method BroadCast which accepts string or binary payload and send the message to all the objects in the collection. The payload in this piece of code is a JSON object.




Now To handle the messages that coming from the server, we are adding below piece of code in JavaScript by implementing a handler for OnMessage.


<image>


In above code we are actually parsing the JSON object that coming from server using JSON.parse method.


To send a message from client to server you can use the below code




Once this message comes to the server, you can check the type of message and can write the code as below




There is a OnClose method which you can override to close your WebSockets connection. For example when user closes the browser this method will fire and closes the connection.




When you run the application then output is as below


 

 



European ASP.NET 4.5 Hosting - Amsterdam :: What is WebSockets and Why Use WebSockets?

clock March 22, 2012 07:39 by author Scott

WebSockets are required to develop the rich and real time web applications. WebSockets can securely enable the real-time web. Before explaining the need of WebSockets we see what current Web is and it’s limitations.

What is Current Web?



We have rich web applications in current web which does the bi-directional communication. HTTP is a request-reply protocol and it is hard to PUSH on top of this protocol. Current programming model use different techniques to get connect with server, one of them is Periodic Polling.




example: Browser uses XmlHttpRequest to periodically query the server.




In Long Polling Server holds the HTTP request until there is a data to return. Client Sends the data as soon as previous request completes.


The limitations with current programming model

-
Periodic polling technique uses high-latency.
-
Long polling programming model is unintuitive.

Many scale out and Bandwidth issues with current programming model and limited cross domain support too.

What All WebSockets about is?

WebSockets is a new interoperable technology still undergoing standardization.

-
It is full duplex bidirectional socket.
-
You can program against using a browser and JavaScript API.
-
WebSockets runs over SSL
-
Designed for high performance – it is a light weight messaging protocol, it requires low bandwidth and latency.
-
Important thing is it is designed to broad reach.
-
WebSockets also has the built-in capability to make cross-domain calls.

What Applications can get benefit from WebSockets?

It supports

-
Rich web applications
-
Real-time applications and services(stock tickers and monitoring systems)
-
Beyond browser – Windows 8 and mobile
-
Online games

WebSockets are in

-
Windows 8
-
Internet Explorer 10
-
.NET 4.5

How it works?

The secret source for WebSockets protocol is HTTP handshake which enables the socket connection. When a client sends an HTTP request to WebSockets server, it contains the some information in header which tells the server to establish connection over WebSockets. If Server is happy to accepts the request and it then sends the HTTP response back to client and switches the protocol and starts the communication.

Once the handshake is complete client and server communicates over WebSockets using HTTP connection. The Message communication is in either binary or UTF8 format.

 



European ASP.NET 4.5 Hosting - Amsterdam :: Request Validation in ASP.Net 4.5 Beta

clock March 21, 2012 12:25 by author Scott

The next version of Microsoft’s ASP.Net framework is currently in Beta and there are some pretty cool changes to how Request Validation works in version 4.5. Up until now, there were two ways to enable or disable request validation:

1. Globally – This controls request validation for the entire application.

2. Per Page – This controls request validation on a per-page basis.

In 4.5, the idea is to allow disabling request validation at the field level. This is a huge improvement, because it allows request validation to be enabled on a much larger scale and only be disabled for specific functionality. The first step in taking advantage of this is to make sure that the request validation mode is set to 4.5 in the web.config (shown below).

<system.web>
  <compilation debug="true" targetFramework="4.5" />
  <httpRuntime requestValidationMode="4.5" targetFramework="4.5"
               encoderType="System.Web.Security.AntiXss.AntiXssEncoder,
               System.Web, Version=4.0.0.0, Culture=neutral,
               PublicKeyToken=b03f5f7f11d50a3a" />

Now that the application is set up for the new validation mode, we can start taking advantage of this.

There are two ways to disable request validation on a specific control, a textbox for example. The first way, and probably the easiest, is to set the validation request mode to “disabled” in the html markup. The code below shows how this would look.

<asp:TextBox ID="txtASPNet" ValidateRequestMode="Disabled" runat="server" />

The second way is to set the validation request mode programmatically. This must be done in one of the earlier events for it to be effective. During my testing, it worked in the Page_Init event, but not in the Page_Load event. The code below shows how to do this in the Page_Init event.

protected
void Page_Init(object sender, EventArgs e)
{

    txtASPNet.ValidateRequestMode = System.Web.UI.ValidateRequestMode.Disabled;
}


Web controls are not the only way to have such granular control over retrieving data without having it run the request validation. A new collection that was added to the request object is called “Unvalidated”. This collection allows accessing specific parameters, form variables for example, without checking the value against request validation. This is possible because Request validation has been modified to run when a variable is used, not when the request is made. It is important to note that web controls are always used, because the framework populates the controls automatically. Lets take a look at accessing an html input field without triggering request validation.


protected
void cmdTest_Click(object sender, EventArgs e)
{

    // Access directly from the Unvalidated collection.
    Response.Write(Request.Unvalidated["txtHtml"].ToString());

    // Specify which Unvalidated collection to access.
    Response.Write(Request.Unvalidated.Form["txtHtml"].ToString());
}


As you can see, there are two ways to access the Unvalidated collections. You can pass the index to the collection directly, or specify exactly which collection you want to retrieve this data from. In this case, it was the forms collection.


Through my testing, I have not yet been able to access Unvalidated.Querystring values because the URL gets run against Request Validation so an exception is thrown before I get a chance to access the unvalidated version. I have not tried the other collections yet.


It is important to remember that manual validation should be performed in addition to using Request Validation. This is especially true for the unvalidated fields, but should also be practiced for fields that are validated. Request Validation is a very limited input validation and does not perform enough validation to be appropriate on its own.



European ASP.NET Hosting - Amsterdam :: How to Fix - "Server Error in '/application name' Application" while browsing an asp.net application

clock March 16, 2012 05:38 by author Scott

You may receive the following error message while browsing an asp.net application

"Server Error in '/application name' Application
--------------------------------------------------------------------------------

Runtime Error
Description: An application error occurred on the server. The current custom error settings for this application prevent the details of the application error from being viewed remotely (for security reasons). It could, however, be viewed by browsers running on the local server machine.

Details: To enable the details of this specific error message to be viewable on remote machines, please create a tag within a "web.config" configuration file located in the root directory of the current web application. This tag should then have its "mode" attribute set to "Off". "


This error might occur due to two scenarios.


1. There is an error in the application's logic with the inputformat, Type etc., and you have set the Custom Error Mode in the web.config to "On" and not specified a default redirect error page.


2. The web.config file is not well formed or having invalid characters and the application is not able to pick up the settings from the same.


Solution

1. Set the custom error mode to "Off" to view the error. After rectifying it and before deployment, change it to "On" and specify a default error page, as follows:-


<customErrors defaultRedirect="ErrorPage.aspx" mode="On">
</customErrors>


such that your users will not be able to see the actual error and get your friendly error page where you can politely say "An error has occured! Sorry for the inconvenience ..." .


2. If the above solution is not working (i.e. even after setting the custom error mode to On, the same "Server Error" occurs, then the likely chance is that your web.config file is not well formed and has invalid characters etc.,


To resolve, it copy paste the contents of the file to a notepad, save it as an xml file and try to browse the xml file in the browser. If the xml file is unable to be rendered by the browser and throws error, then you can find the place where the tags are not well formed or invalid character(s) exist and rectify them.


Things worth noting is Web.config is case sensitive and even trailing / leading spaces can cause the above error.


This article applies to .NET - ASP.NET 1.0, 1.1 Versions. Hope it help



Premier European HostForLIFE.eu Launches ASP.NET 4.5 Hosting Beta

clock March 7, 2012 07:22 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 new FREE ASP.NET 4.5 beta hosting in our entire servers environment.

You can start hosting your ASP.NET 4.5 beta site on our environment for FREE. For more information about our new product, please visit our site at http://www.hostforlife.eu/ASPNET-45-Beta-European-Hosting.aspx

"This is limited program offered as an open beta for developers on a first come first serve basis. Our .NET 4.5 beta hosting account comes with 50 MB disk space and 50 MB SQL 2008 database space. With this .NET 4.5 beta release, we prove our existence in this hosting world and also we want the developers to give it try with the newest .net 4.5 in our hosting environment." said John Curtis, VP Marketing and Business Development at HostForLIFE.eu

So, why wait longer? Please visit http://www.hostforlife.eu/ASPNET-45-Beta-European-Hosting.aspx to register new account.

About us

We are European Windows Hosting Provider which FOCUS in Windows Platform ONLY. We support Microsoft technology, such as the latest ASP.NET 4, ASP.NET MVC 3, SQL 2008/2008 R2, and much more.

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

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



European ASP.NET 4 Hosting - Amsterdam :: How to Fix Error - An ASP.NET setting has been detected that does not apply in Integrated managed pipeline mode

clock March 1, 2012 10:01 by author Scott

Sometime when you try to setup a application for your website on IIS7 you get following error when you load your website.



This happens when ASP.NET modules and handlers should be specified in the IIS and configuration sections in Integrated mode. This problem can be fixed using following workaround


1) Change application configuration: First way to fix this issue is to migrate the application configuration to work properly in Integrated mode. You can use “
AppCmd“ command to migrate the application configuration:

%windir%/system32/inetsrv/>Appcmd migrate config “<AppPath>


Where “
<AppPath>“ is the virtual path of the application, such as “Default Web Site/virtualapp1“.

2) Modify web.config: You have to manually move the customer entries in the
<system.web>/<httpModules> and configuration to the <system.web>/<httpHandlers><system.webServer>/<handlers> and <system.webServer>/<modules> configuration sections, and either remove the <httpHandlers> and <httpModules> configuration OR add the following to your application’s or websites web.config:

<system.webServer>
<validation validateIntegratedModeConfiguration=”false”/>
</system.webServer>


3) Switch to Classic ASP.NET: Switch the website or application to an application pool that is configured to run in Classic ASP.NET mode. To move back to classic mode go to
IIS7 Manager >> Select the site (which you want to switch) >> edit settings and you will get following screen



Press “
Select” button which will open a window “Select Application Pool” (check below image); Select “Classic .NET AppPool” from the drop-down and press OK.



Now try to Access your website/application.



European ASP.NET 4 Hosting :: How to Redirect From domain.com to www.domain.com in ASP.NET

clock February 21, 2012 07:35 by author Scott

If you want to redirect from domain.com to www.domain.com in asp.net application, then you can do it through IIS settings, but you can do it through code file also. You can write the code in the global.asax file in the Application_BeginRequest method.

void Application_BeginRequest(object sender, EventArgs e)
    {
        string FromHomeURL = "http://yourdomain.com";
        string ToHomeURL = "http://www.yourdomain.com";


       if (HttpContext.Current.Request.Url.ToString().ToLower().Contains(FromHomeURL))
        {
            HttpContext.Current.Response.Status = "301 Moved Permanently";
            HttpContext.Current.Response.AddHeader("Location",
            Request.Url.ToString().ToLower().Replace(FromHomeURL, ToHomeURL));
        }
}



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