All About ASP.NET and ASP.NET Core 2 Hosting BLOG

Tutorial and Articles about ASP.NET and the latest ASP.NET Core

ASP.NET Hosting - ASPHostPortal.com :: How to set up Output Caching in ASP.NET

clock May 17, 2016 19:52 by author Armend

How to set up Output Caching in ASP.NET

Hi today we are talking about Output Caching in ASP.NET , so i hope you will enjoy and get something from it .

What is Output Caching ?

Output caching has enabled developers to store the generated output of pages, controls, and HTTP responses in memory. On subsequent Web requests, ASP.NET can serve content more quickly by retrieving the generated output from memory instead of regenerating the output from scratch.

Limitation :

Generated content always has to be stored in memory, and on servers that are experiencing heavy traffic, the memory consumed by output caching can compete with memory demands from other portions of a Web application.

Role in ASP.NET  5 :

ASP.NET 5 adds an extensibility point to output caching that enables you to configure one or more custom output-cache providers. Output-cache providers can use any storage mechanism to persist HTML content. This makes it possible to create custom output-cache providers for diverse persistence mechanisms, which can include local or remote disks, cloud storage, and distributed cache engines.

You create a custom output-cache provider as a class that derives from the new System.Web.Caching.OutputCacheProvider type. You can then configure the provider in the Web.config file by using the new providers subsection of the outputCache element, as shown in the following example:

<caching>
<outputCache defaultProvider="AspNetInternalProvider">
<providers>
<add name="DiskCache"
type="Test.OutputCacheEx.DiskOutputCacheProvider, DiskCacheProvider"/>
</providers>
</outputCache>
</caching>


By default in ASP.NET 4, all HTTP responses, rendered pages, and controls use the in-memory output cache.You can change the default output-cache provider used for a Web application by specifying a different provider name for defaultProvider.

<%@ OutputCache Duration="60" VaryByParam="None" providerName="DiskCache" %>

 

Specifying a different output cache provider for an HTTP request requires a little more work. Instead of declaratively specifying the provider, you override the new GetOuputCacheProviderName method in the Global.asax file to programmatically specify which provider to use for a specific request. The following example shows how to do this.

public override string GetOutputCacheProviderName(HttpContext context)
{
if (context.Request.Path.EndsWith("Advanced.aspx"))
return "DiskCache";
else
return base.GetOutputCacheProviderName(context);
}

With the addition of output-cache provider extensibility to ASP.NET 4, you can now pursue more aggressive and more intelligent output-caching strategies for your Web sites. For example, it is now possible to cache the “Top 10” pages of a site in memory, while caching pages that get lower traffic on disk.



ASP.NET Hosting - ASPHostPortal.com :: 5 Tips to Check Before Choose FREE ASP.NET Hosting Provider

clock May 11, 2016 21:22 by author Armend

5 Tips to Check Before Choose FREE ASP.NET Hosting Provider

Hosting Account Setup

After you place an order of web hosting you should get hosting account instantly or it should not be delayed more than 12 hours and the another thing there is very little effort required in creating a new hosting service so it should be free. But you can see so many web hosts charge you money as a setup fee that's just silly.

 

Web Space and Bandwidth

As you might aware web resources are always limited like there is fixed amount and quantity of hard drive, ram, cpu in the web server and looking for unlimited package is just a impractical idea. Ftp or upload complete personal website data to your hosting space you require only 20mb web space to 100mb web space maximum so why looking for unlimited features? Most of cheap unlimited hosting providers have data server outage issue repeatedly so selecting unlimited web hosting in cheap price can cease your expensive website data.

Technical support for customers

There is already big giant in web hosting, cheap hosting and free hosting industry which have very professional sales team for the clients and they use all mode of support system for the new clients via phone, live chat, ticket, email, voip but when it is the time to raise a technical issue concerned to your hosting account that time there would be the problem and so many of your hosting issue wont be resolved by their technical customer support. So besides searching for cheap hosting price you should also look for skilled and good customer support system for tech.

Control Panel and Hosting Features

Various control panel for web disk are available and many are worst and few are excellent and easy to manage. Mostly client had issue with windows panel like plex and cpanel is very familiar. Many hosts provide multiple domains hosting in a single hosting account which is cheap and easy to handle but when you require is to transfer or migrate your hosting account from old hosting to new hosting in that time probably there would be the problem. In your hosting you should look for database, ftp, php, phpMyadmin, MySql, application installer, virus scanner, email accounts, subdomain, folder locker, url forwarding, backup, seo tool etc at free of cost without upgrades.

Always Read the Terms and Conditions

You are agreed with terms and conditions before you start hosting with them so make sure you read all the terms, refund policy, money laundering policy, resource abuse policy, privacy policy etc.

 



ASP.NET hosting -ASPHostPortal.com :: Top 10 Tips You Shall Know on Choosing ASP.NET Hosting

clock April 22, 2016 20:34 by author Armend

Top 10 Tips You Shall Know on Choosing ASP.NET Hosting

Being devoted into ASP.NET development and ASP.NET website hosting for a couple of years, we know the secrets hidden in the ASP.NET hosting advertisement and how difficult to find a trusted and cost effective ASP.NET hosting provider. Thus, we would like to show you the top 10 tips on choosing ASP.NET hosting providers before starting with our topic.

  1. MS SQL Server database edition and limitation. The latest version of MSSQL 2012 are preferred.
  2. .NET Framework versions. Does it support the version used for your website?
  3. ASP.NET MVC versions. Does it support the version used for your website if you’re using ASP.NET MVC technology?
  4. Does it provide the dedicated application pool so that you won’t be affected by your neighbors?
  5. How long the IIS is set to recycle your website – usually 30 minutes at least is required.
  6. What’s the maximum dedicated memory allowed for the ASP.NET websites?
  7. The hosting provider needs to have the rich experiences and knowledge of how to ensure the high-quality ASP.NET hosting. Besides, it is great that they have got plenty of positive feedbacks from real customers and have been trusted and recommended by a lot of authorities, communities and hosting review sites.
  8. The ASP.NET hosting needs to ensure a high level of hosting reliability with at least 99.9% uptime. Note that this can be achieved with the utilization of cutting-edge data centers, solid server machines and no overselling practice. In addition, some confident web hosts even claim to give you some compensations if they fail to meet their promised uptime track record.
  9. The hosting speed is also pretty essential. After all, your readers can be frustrating if they find it takes a long time for accessing your website. In this case, you need to figure out that whether your web host can ensure the peak performance with no more than 3 seconds for page loading and 400 ms for the server response.
  10. The web host needs to ensure the all-time-rounded technical support to assist you 24 hours a day and 7 days a week. Also, their support staffs need to have the rich knowledge about ASP.NET hosting and related applications.

General Knowledge about ASP.NET

ASP.NET is the server-side online application framework coming with the open source nature. It is designed with the purpose of web development and dynamic webpages production mainly. In addition, developed by Microsoft, ASP.NET has been used by a lot of programmers for the creation of complicated websites, online applications and add-on services.
In fact, ASP.NET has been released since January 2002, which is the successor to the Active Server Pages technology of Microsoft. As it is built based on the Common Language Runtime, developers and programmers can write the ASP.NET code with the help of .NET language.

 



ASP.NET Hosting - ASPHostPortal.com :: Why Server Speed is Important for Increasing Revenues

clock April 12, 2016 19:31 by author Armend

Why Server Speed is Important for Increasing Revenues

If your website loads slower and takes long to respond you are literally killing your sales and revenue with your own hands. Today, the key to more sales and conversion is the combination of effective content with faster loading speed of your website. The speed of your website is the time taken from a web page to become visible on the screen after it has been requested by the browser.

The latest surveys showed that loading speed of websites has a great impact on the traffic trends. The speed of the website has a great importance, a slow website could easily frustrate your potential customers forever.

 

A slow website reflects low revenue

Often the slower websites have high bounce rates with poor sales. A number of studies have proven that the average visitors will leave your website if it does not become accessible in 3 to 6 seconds. Slower website is not only a reason to decrease your sales but the frustrated visitors are likely to develop a negative perception about your business.

Does Speed of the website can increase the revenue?

Did you know the world popular brand Shopzilla generated 12% more revenue by simply improving the website speed from 6 seconds to 1.2 seconds?

It is no more a secret that google records the web page speed to determine the ranking of the website along with other organic ranking factors. You can check the speed of your pages by inspecting the Google webmaster tools.

According to latest calculated formula you can improve 2% of conversion rate by simply speeding up the website by every single second. Shopzilla , Amazon, Yahoo and Mozilla experienced a great boost in business by speeding up the loading speed of the web pages to less than 3 seconds.

Shopzilla increased 12% revenue along with 25% increased page views
Yahoo got a 9% increase in the traffic
Mozilla got 60 million more downloads by simply improving the web page speed to 2.2 seconds faster

How fast is fast enough for a web page?

The ideal loading time of a website is under 3 seconds. If your website becomes visible in 5 seconds it seems to be good. If it is under 10 seconds it is considered to be as fair. However if your website exceeds 10 seconds you are losing the ranking and conversion. The slower your website is the less sales you will have.
There are several performance metric tools available to report the performance of your website speed along with web page improvement suggestions. You can optimize the structure of your code to get faster responses. However you certainly need hosting power to execute your application quickly to load your website faster.

Choose fast dedicated server for faster website

The speed of a website mainly depends on the architecture of your web pages, databases and the speed of hosting servers. Going with the right kind of web hosting could make or break your website ranking. Shared hosting and dedicated hosting are two major types of hosting service available online. Shared service has a low price with low resources available. Shared hosting is designed to deliver small websites with low traffic. Dedicated hosting is an expensive option with more power and performance.
Businesses are adapting dedicated server technology for more speed and power. All sorts of critical online businesses can reap the benefit of fast powerful dedicated hosting. Server speed may be the issue if your website resides on one of the cheapest shared or vps hosting service holding hundreds of websites. Shared hosting can not offer you the true speed and reliability as its resources are shared by many websites hosted on the same computer. If you have a business website, mobile application or a professional service website, fast dedicated hosting can make a difference in search engine ranking.

Below are some great advantages of dedicated hosting for faster website.

  • Your website will load faster
    • The dedicated server is a powerful machine designed and configured to execute the processes in fastest manners. Dedicated hosting has more reliable infrastructure, bandwidth and resources as compared to any other type of hosting service. Dedicated hosting enables your website to execute faster and tremendously increase the loading speed of your website.
  • Your website will be more secure
    • Another great advantage of dedicated hosting is the safety of your business data. Usually hackers break into the websites by locating a poorly coded website hosted nearby on shared hosting environment. If you have hammer tested your code for common vulnerabilities you can easily lock down your server for better security and data safety.
  • Your website will handle more traffic
    • If you have a popular website or advertising your business you may experience sudden traffic spikes at certain times. Dedicated server enables you to tackle high load without going down. If you have optimized your code and server you are in a better position to handle your website traffic faster and smoothly.


ASP.NET Hosting - ASPHostPortal.com :: How to Call ASP.NET Page Methods using your own AJAX

clock March 15, 2016 20:04 by author Armend

ASP.NET has grown very rich day by day. Recently Microsoft has introduced JQuery as a primary javascript development tool for client end application. Even though there is a number of flexibility in ASP.NET AJAX applications, many developers do seek place to actually call a page using normal AJAX based application. In this post I will cover how you can invoke an ASP.NET page method directly from your own AJAX library.

What are page methods?

A Page method is a method that is written directly in a page. It is generally called when the actual page is posted back and some event is raised from the client. The pageMethod is called directly from ASP.NET engine.

What is a WebMethod?

A WebMethod is a special method attribute that exposes a method directly as XML service. To implement PageMethod we first need to annotate our method as WebMethod.
Steps to Create the application :
1. Start a new ASP.NET Project.
2. Add JQuery to your page. I have added a special JQuery plugin myself which stringify a JSON object. The post looks like below :

(function ($) {
$.extend({
toJson: function (obj) {
var t = typeof (obj);
if (t != "object" || obj === null) {
// simple data type
if (t == "string") obj = '"' + obj + '"';
return String(obj);
}
else {
// recurse array or object
var n, v, json = [], arr = (obj && obj.constructor == Array);
for (n in obj) {
v = obj[n]; t = typeof (v);
if (t == "string") v = '"' + v + '"';
else if (t == "object" && v !== null) v = JSON.stringify(v);
json.push((arr ? "" : '"' + n + '":') + String(v));
}
return (arr ? "[" : "{") + String(json) + (arr ? "]" : "}");
}
}
});
// extend plugin scope
$.fn.extend({
toJson: $.toJson.construct
});
})(jQuery);

The code actually extends JQuery to add a method called toJSON to its prototype.

3. Add the server side method to the Default.aspx page. For simplicity we actually return the message that is received from the client side with some formatting.

[WebMethod]
public static string DisplayTime(string message)
{
// Do something
return string.Format("Hello ! Your message : {0} at {1}", message, DateTime.Now.ToShortTimeString());
}

Remember : You should make this method static, and probably should return only serializable object.

4. Add the following Html which actually puts one TextBox which takes a message and a Button to call server.

<asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="MainContent">
<h2>
Welcome to ASP.NET!
</h2>
<p>
Write Your message Here : <input type="text" id="txtMessage" />
</p>
<p>
<input type="button" onclick="javascript:callServer()" value="Call Server" />
</p>
</asp:Content>
Once you add this html to your default.aspx page, add some javascript to the page. We add the JQuery and our JSONStringify code to it.
<script src="Scripts/jquery-1.4.1.min.js" type="text/javascript"></script>
<script src="Scripts/JSONStringify.js" type="text/javascript"></script>
<script type="text/javascript">
function callServer() {
var objdata = {
"message" : $("#txtMessage").val()
};
$.ajax({
type: "POST",
url: "Default.aspx/DisplayTime",
data: $.toJson(objdata),
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function (msg) {
alert(msg.d);
},
error: function (xhr, ajaxOptions) {
alert(xhr.status);
}
});
}
</script>

The above code actually invokes a normal AJAX call to the page. You can use your own library of AJAX rather than JQuery to do the same. On success, it returns the serializable object to msg.d.



ASP.NET Hosting - ASPHostPortal.com :: Entity Framework 7 Providing support for new platforms

clock March 8, 2016 20:40 by author Armend

EF (Entity Framework) is Microsoft's flagship data access platform -- an extended ORM (Object Relational Mapper) that abstracts the calls to the ADO.Net data access provider underneath. It is an open source ORM framework for ADO.Net and is included as part of .Net Framework. The first version of Entity Framework (EFv1) was released as part of .Net Framework 3.5 Service Pack 1 and Visual Studio 2008 Service Pack 1 in the year 2008.

In using Entity Framework, you can work with relational data using domain-specific objects. Entity Framework has been the technology of choice for building data access layer while working with WPF, WinForms, MVC, WebAPI, WebForms and WCF applications. Here are a few design documents on Entity Framework 7.
The latest version of this ORM is Entity Framework 7. Microsoft's vision for Entity Framework 7 is "New Platforms, New Data Stores". This implies that Entity Framework 7 is an extensible and lightweight version of Entity Framework that enables provides support for new platforms and new data stores. Entity Framework 7 is a major redesign of Entity Framework and is the default data stack for ASP.Net 5 applications.

I would like to highlight some of the striking features of EF7 in this post. To get started working with Entity Framework 7 you should add the Entity Franework 7 NuGet packages to your project.
Here's quick glance at what's new in Entity Framework 7:

  • Support for non-relational data stores and in-memory data
  • Support for Windows Phone and Windows Store applications
  • Support for Linux and Macintosh machines

Support for non-relational data stores and in-memory data

NoSQL databases are widely popular these days primarily because of performance -- CRUD operations on these database are faster compared to their relational counterparts. NoSQL databases are a good choice when you have to work with a large volume of data - particularly useful in statistical or real-time analysis of data. Entity Framework 7 now provides support for non-relational databases as well. The support for no-SQL in Entity Framework 7 is great. Interestingly, for querying and updating data in non-relational databases, you can use the same approach you are familiar with.
The following code snippet illustrates how you can use Entity Framework 7 with Microsoft Azure Table Storage to initialize a connection to the database.

public class StoresContext : DbContext
 {
  protected override void OnConfiguring(DbContextOptions options)
 {
   var connection =
   ConfigurationManager.ConnectionStrings["StoresDBConnection"]
   .ConnectionString;
   options.UseAzureTableStorage(connection);
  }
 }

The supported providers in Entity Framework 7 include:

  • SQL Server
  • SQLit
  • Azure Table Storage
  • Redis
  • In Memory (for unit testing)

Support for Windows Phone, Windows Store applications and Linux and Macintosh platforms

With Entity Framework 7, Windows Phone, Windows Store and ASP.Net 5 and desktop applications can leverage Entity Framework. Entity Framework 7 would work on SQLLite database -- the database of choice for mobile devices. Entity Framework 7 also provides support for Linux and Macintosh systems where Mono framework has been installed.

Entity Framework 7 is Lightweight and Extensible

Entity Framework 7 is lightweight and extensible -- it comes with more features and flexibility and enhanced performance. Another major change will be the "code first only" approach -- all models in Entity Framework 7 will be represented in the code. You would however be able to reverse engineer a model from the underlying database thanks to the tooling support. Code based modeling is preferred as it is less repetitive and easier to use and manage.

Enhanced support for Unit testing

Unit testing allows you to test blocks or units of the source code. Unit testing is simpler with EntityFramework 7. The code snippet given below shows a sample unit test.

[TestMethod]
public void SampleTest()
{
var options = new DbContextOptions()
.UseInMemoryStore();
using (var db = new StoresContext(options))
{
//Code to perform CRUD operations
//Assert the results
}
}

Effort is an easy to use and powerful unit testing tool for applications that use Entity Framework. It is actually an ADO.Net provider that comes with some helper methods that enables you to execute the CRUD operations on a lightweight in-memory database for faster execution. Effort is an Entity Framework provider that runs in memory. When writing your unit tests you can still use your familiar DbContext or ObjectContext classes. Most importantly, you are not constrained to have an actual database – your unit tests would be executed against the in-memory database.



Cheap ASP.NET 4.5 Hosting

We’re a company that works differently to most. Value is what we output and help our customers achieve, not how much money we put in the bank. It’s not because we are altruistic. It’s based on an even simpler principle. "Do good things, and good things will come to you".

Success for us is something that is continually experienced, not something that is reached. For us it is all about the experience – more than the journey. Life is a continual experience. We see the Internet as being an incredible amplifier to the experience of life for all of us. It can help humanity come together to explode in knowledge exploration and discussion. It is continual enlightenment of new ideas, experiences, and passions


Author Link

 photo ahp banner aspnet-01_zps87l92lcl.png

 

Corporate Address (Location)

ASPHostPortal
170 W 56th Street, Suite 121
New York, NY 10019
United States

Tag cloud

Sign in