Compacting out-of-Process Session Data

We
like using the Session object (We like the Cache object even better). Many developers object to the Session object because it imposes a footprint on the server even when a user isn't requesting a page. In ASP.NET 4 the sessionState tag in the web.config file now has a new attribute called compressionEnabled that causes serialized to data to be automatically compressed. Here's what it looks like:

<sessionState
         compressionEnabled=”true”. . .

Session data is only serialized if you're using a state server (where mode is set to "StateServer") or a database (mode="SqlServer"). But in those scenarios, this option will lower the impact of the user's footprint when storing data in the Session object -- provided you're willing to spend the CPU cycles to compact and un-compact your data.

Permanently Redirecting a Page

It would be wonderful if we never changed the URLs for our pages. However, in the real world that doesn't happen. Pages move around. Rather than let users get 404 errors when requesting a page using a URL that's worked in the past, ASP.NET programmers often put a Response.Redirect in the Page Load of the old page and have that Redirect send the user to the new location of the page.

In ASP.NET 4, you can now use the Response.RedirectPermanent method in the same way. RedirectPermanent issues HTTP 301 messages which signal to the client that this is a permanent redirection. Provided the client recognizes 301 messages, the client will automatically substitute the new URL for the old URL whenever the user requests the old URL, skipping the trip to the old location.

Alternatively, you could use Routing, which eliminates this problem. Implementing routing is much simpler in ASP.NET 4 and I'll cover that topic in a later column.

Control-Level Changes

Probably the most important change to existing controls is invisible: Many controls will be generating different HTML in ASP.NET 4. Partially this is a move to produce HTML that is more complaint with XHTML 4.0; partially it is an effort to produce HTML that CSS authors (i.e. not me) will find easier to style. Overall, there's a sharp reduction in the number of table tags being produced. However, if you have code that's dependent on the old HTML format, you can add this element to your config file to keep the old HTML:

<pages controlRenderingCompatibilityVersion=”3.5”/>

In the past, if you wanted to reduce the size of a page's ViewState, you considered setting the EnableViewState property on the Page to False. However, that disabled ViewState for all the controls on the page, and usually there were some controls that needed the ViewState. The alternative was to disable ViewState on each control where you didn't need it -- typically most of the controls on the page. Now in ASP.NET 4, you can disable ViewState for the Page and set EnableViewStateMode to Enabled on the controls where you actually need ViewState.

What is so SPECIAL on HostForLife.eu ASP. Net 4 Hosting?

We know that finding a cheap, reliable web host is not a simple task so we’ve put all the information you need in one place to help you make your decision. At HostForLife, we pride ourselves in our commitment to our customers and want to make sure they have all the details they need before making that big decision.

We will work tirelessly to provide a refreshing and friendly level of customer service. We believe in creativity, innovation, and a competitive spirit in all that we do. We are sound, honest company who feels that business is more than just the bottom line. We consider every business opportunity a chance to engage and interact with our customers and our community. Neither our clients nor our employees are a commodity. They are part of our family.

The followings are the top 10 reasons you should trust your online business and hosting needs to us:

- FREE domain for Life - HostForLife gives you your own free domain name for life with our Professional Hosting Plan and 3 free domains with any of Reseller Hosting Plan! There’s no need to panic about renewing your domain as HostForLife will automatically do this for you to ensure you never lose the all important identity of your site
- 99,9% Uptime Guarantee – HostForLife promises it’s customers 99.9% network uptime! We are so concerned about uptime that we set up our own company to monitor people’s uptime for them called HostForLife Uptime
- 24/7-based Support - We never fall asleep and we run a service that is opening 24/7 a year. Even everyone is on holiday during Easter or Christmast/New Year, we are always behind our desk serving our customers
- Customer Tailored Support - if you compare our hosting plans to others you will see that we are offering a much better deal in every aspect; performance, disk quotas, bandwidth allocation, databases, security, control panel features, e-mail services, real-time stats, and service
- Money Back Guarantee - HostForLife offers a ‘no questions asked’ money back guarantee with all our plans for any cancellations made within the first 30 days of ordering. Our cancellation policy is very simple - if you cancel your account within 30 days of first signing up we will provide you with a full refund
- Experts in ASP. Net 4 Hosting
- Given the scale of our environment, we have recruited and developed some of the best talent in the hosting technology that you are using. Our team is strong because of the experience and talents of the individuals who make up HostForLife
- Daily Backup Service - We realise that your website is very important to your business and hence, we never ever forget to create a daily backup. Your database and website are backup every night into a permanent remote tape drive to ensure that they are always safe and secure. The backup is always ready and available anytime you need it
- Easy Site Administration - With our powerful control panel, you can always administer most of your site features easily without even needing to contact for our Support Team. Additionally, you can also install more than 100 FREE applications directly via our Control  Panel in 1 minute!

Happy Hosting!