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 :: How to access a MySQL database with .NET

clock November 24, 2011 03:49 by author Jervis

In this tutorial, I will show you how to access a MySQL database with .NET, instead of using SQL Server. If you are installing it on your own server, you need to download MySQL and install it, then run c:\mysql\bin\winmysqladmin.exe. You also need to download the ODBC driver (choose Windows Downloads Driver Installer) and install it. Then use this code to access your MySQL database.

<%@ import Namespace="System.Data" %>
<%@ import Namespace="System.Data.Odbc" %>
<%@ Page Language="C#" %>
<script runat="server">
public void Page_Load(Object sender, EventArgs e) {
    DataTable dtRecords = GetDataTable("SELECT * FROM newone");
    foreach(DataRow dr in dtRecords.Rows) {
        Response.Write(dr["FirstName"].ToString() + " " + dr["LastName"].ToString() + "<br/>");
    }
}

private static string GetConnection() {
    return "DRIVER={MySQL ODBC 3.51 Driver};Server=localhost;Database=testdatabase";
}
public static DataTable GetDataTable(string sql) {
    DataTable rt = new DataTable();
    DataSet ds = new DataSet();
    OdbcDataAdapter da = new OdbcDataAdapter();
    OdbcConnection con = new OdbcConnection(GetConnection());
    OdbcCommand cmd = new OdbcCommand(sql, con);
    da.SelectCommand = cmd;
    da.Fill(ds);
    try {
        rt = ds.Tables[0];
    }
    catch {
        rt = null;
    }
    return rt;
}

</script>

Simple, right? Try it on your end. Good luck.

Reasons why you must trust ASPHostPortal.com

Every provider will tell you how they treat their support, uptime, expertise, guarantees, etc., are. Take a close look. What they’re really offering you is nothing close to what ASPHostPortal does. You will be treated with respect and provided the courtesy and service you would expect from a world-class web hosting business.

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:

-
DELL Hardware
Dell hardware is engineered to keep critical enterprise applications running around the clock with clustered solutions fully tested and certified by Dell and other leading operating system and application providers.
- Recovery Systems
Recovery becomes easy and seamless with our fully managed backup services. We monitor your server to ensure your data is properly backed up and recoverable so when the time comes, you can easily repair or recover your data.
- Control Panel
We provide one of the most comprehensive customer control panels available. Providing maximum control and ease of use, our Control Panel serves as the central management point for your ASPHostPortal account. You’ll use a flexible, powerful hosting control panel that will give you direct control over your web hosting account. Our control panel and systems configuration is fully automated and this means your settings are configured automatically and instantly.
- Excellent Expertise in Technology
The reason we can provide you with a great amount of power, flexibility, and simplicity at such a discounted price is due to incredible efficiencies within our business. We have not just been providing hosting for many clients for years, we have also been researching, developing, and innovating every aspect of our operations, systems, procedures, strategy, management, and teams. Our operations are based on a continual improvement program where we review thousands of systems, operational and management metrics in real-time, to fine-tune every aspect of our operation and activities. We continually train and retrain all people in our teams. We provide all people in our teams with the time, space, and inspiration to research, understand, and explore the Internet in search of greater knowledge. We do this while providing you with the best hosting services for the lowest possible price.
- Data Center
ASPHostPortal modular Tier-3 data center was specifically designed to be a world-class web hosting facility totally dedicated to uncompromised performance and security
- Monitoring Services
From the moment your server is connected to our network it is monitored for connectivity, disk, memory and CPU utilization – as well as hardware failures. Our engineers are alerted to potential issues before they become critical.
- Network
ASPHostPortal has architected its network like no other hosting company. Every facet of our network infrastructure scales to gigabit speeds with no single point of failure.
- Security
Network security and the security of your server are ASPHostPortal’s top priorities. Our security team is constantly monitoring the entire network for unusual or suspicious behavior so that when it is detected we can address the issue before our network or your server is affected.
- Support Services
Engineers staff our data center 24 hours a day, 7 days a week, 365 days a year to manage the network infrastructure and oversee top-of-the-line servers that host our clients’ critical sites and services.



ASP.NET 4 Hosting - ASPHostPortal :: How to Configure Web Application to Utilise ASP.NET Application Services Database

clock November 22, 2011 04:47 by author Jervis

I come across multiple number of repeating postings at www.asp.net/forums with exceptions when post holders try to utilise ASP.NET application services database to authenticate or authorise end users. Common exceptions noted are ‘sql exceptions’ or ‘Invalid end user credentials when tried to use Login control’ or similar exception.

The reason behind most of these exceptions are not configuring web application to utilise SQL Server installed ASP.NET Application Services database. When responding to those repeating postings on asp.net forums i decided to write an article explaining this process instead of repeating the same info multiple times.

This article explains step by step process of configuring ASP.NET Web application to utilise SQL Server installed ASP.NET Application Services database.

1.       Copying and configuring connection String

2.       Copying and configuring Membership, Roles and Profile sections

3.       Using ASP.NET Web application Configuration tool to choose providers

Hope you find it helpful.

STEP 1 - Copying and Configuring Connection String

Note that configuration settings in Web.config file are inherited from machine.config file on your machine. In order to configure web application to utilise Application Services database it is required to copy related sections from machine.config file, which is located at

C:\windows\Microsoft.NET\Framework\v2.0.50727\CONFIG

NB:- Make sure that you are not making any changes to your machine.config file.

To Do:- Copy connection string from machine.config file as shown below.

<connectionStrings>
      <add name="LocalSqlServer"
      connectionString="data source=.\SQLEXPRESS;
      Integrated Security=SSPI;
      AttachDBFilename=|DataDirectory|aspnetdb.mdf;
      User Instance=true"
      providerName="System.Data.SqlClient"/>
</connectionStrings>

To Do:- Paste above connection string from machine.config into Web.config and change required properties as shown below.

<add name="<Connection String Name>"
connectionString="Server=<SQL Server NAME>;
Database=<ASP.NET Application services Database NAME>;
User ID=<user ID>;
Password=<password>"
providerName="System.Data.SqlClient"
/>

STEP 2 – Copying and Confguring Membership, Roles, and Profile Sections

Note that depending on your application requirements you need either or combination or all of these three sections.

1.       Membership

2.       Roles

3.       Profile

To Do:- Copy Membership, Roles and Profile sections from machine.config into Web.config and configure required properties.

<membership>
      <providers>

      <add name="AspNetSqlMembershipProvider"
        type="System.Web.Security.SqlMembershipProvider,
      System.Web, Version=2.0.0.0, Culture=neutral,
      PublicKeyToken=b03f5f7f11d50a3a"
      connectionStringName="LocalSqlServer"
      enablePasswordRetrieval="false"
      enablePasswordReset="true"
      requiresQuestionAndAnswer="true"
      applicationName="/"
      requiresUniqueEmail="false"
      passwordFormat="Hashed"
      maxInvalidPasswordAttempts="5"
      minRequiredPasswordLength="7"
      minRequiredNonalphanumericCharacters="1"
      passwordAttemptWindow="10"
      passwordStrengthRegularExpression=""/>   

      </providers>
</membership>

<profile>
      <providers>

      <add name="AspNetSqlProfileProvider"
      connectionStringName="LocalSqlServer"
      applicationName="/"
      type="System.Web.Profile.SqlProfileProvider,
      System.Web, Version=2.0.0.0, Culture=neutral,        
        PublicKeyToken=b03f5f7f11d50a3a"/>     

      </providers>
</profile>

<roleManager>
      <providers>

      <add name="AspNetSqlRoleProvider"
      connectionStringName="LocalSqlServer"
      applicationName="/"
      type="System.Web.Security.SqlRoleProvider,
      System.Web, Version=2.0.0.0, Culture=neutral,
      PublicKeyToken=b03f5f7f11d50a3a"/> 

      </providers>
</roleManager>

To Do:- After copying above sections into Web.config, make sure you modify minimum required attributes such as name, connectionStringName and ApplicationName

-          Note that depending on your application requirements you may modify other attributes mostly in Membership section.

After modifying minimum attributes in Membership, Roles and Profile sections, these sections looks similar as shown below.

<membership defaultProvider="AspNetMembershipProvider">
      <providers>
      <add connectionStringName="<AspNetServices
      Connectionstring Name from connectionstrings
      section"
      enablePasswordRetrieval="false"
      enablePasswordReset="true"
      requiresQuestionAndAnswer="true"
      applicationName="<WEB APP NAME>"
      requiresUniqueEmail="false"
      passwordFormat="Clear"
      maxInvalidPasswordAttempts="5"
      minRequiredPasswordLength="7"
      minRequiredNonalphanumericCharacters="0"
      passwordAttemptWindow="10"
      passwordStrengthRegularExpression=""
      name="AspNetMembershipProvider"
        type="System.Web.Security.SqlMembershipProvider,
      System.Web, Version=2.0.0.0, Culture=neutral,
        PublicKeyToken=b03f5f7f11d50a3a"/>
      </providers>
</membership>

<roleManager enabled="true" defaultProvider="AspNetRoleProvider">
      <providers>
      <add connectionStringName="<AspNetServices
      Connectionstring Name from connectionstrings
      section"
      applicationName="<ASP.NET application NAME>"
      name="AspNetRoleProvider"
      type="System.Web.Security.SqlRoleProvider,
      System.Web, Version=2.0.0.0, Culture=neutral,
        PublicKeyToken=b03f5f7f11d50a3a"/>
      </providers>
</roleManager>

<profile>
      <providers>

      <add name="<ProfileProvider Name>"
      connectionStringName="<From above connectionStirngs
      section that is pointing to Servies database>"
      applicationName="/<Your ASP.NET app Name>"
      type="System.Web.Profile.SqlProfileProvider,
      System.Web, Version=2.0.0.0, Culture=neutral,
        PublicKeyToken=b03f5f7f11d50a3a"/>     

      </providers>
</profile>

NB:- Make sure that application Name property is set at all the time as suggested by Scott Guthrie here.

STEP 3 – Using ASP.NET Web Application Configuration tool to choose providers

After adding and modifying required sections as explained above, save your Web.config and configure your web application to utilise ASP.NET Application Services Database as explained below.


To Do
:- Start ASP.NET Configuration tool from Website menu (shown below). Note that ASP.NET configuration tool can be initiated from Solution Explorer menu as well. 



Selecting ASP.NET Configuration opens Web Site Administration Tool in browser.

To Do:-Select Provider Configuration hyperlink as shown below.



Selecting Provider Configuration navigates to Provider page where you can choose either Single provider or different provider for each feature as shown below.

-          To Do:- You can choose either of the above options available. For this tutorial choosing ‘Select a different provider each feature’ option. By doing so each providercan choose different data sources.

Selecting Select a different provider for each feature (advanced) hyperlink navigates to next page where you can select a provider for each feature as shown below.



On this screen you can see provider name(from provider section), choose a provider for each feature i.e., Membership, Roles and Profile and select Ok.

Thats it. You are ready to fly! Configuration is done.

·    Testing:- In order to make sure your ASP.NET application services database is configured to be used by web application, you can create a new user by selecting Security tab with in Web Site Administration tool, then Create User hyperlink. After creating the user make sure that you see the same information in ASP.NET Application Services database aspnet_Users

Reasons why you must trust ASPHostPortal.com

Every provider will tell you how they treat their support, uptime, expertise, guarantees, etc., are. Take a close look. What they’re really offering you is nothing close to what ASPHostPortal does. You will be treated with respect and provided the courtesy and service you would expect from a world-class web hosting business.

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:

-
DELL Hardware
Dell hardware is engineered to keep critical enterprise applications running around the clock with clustered solutions fully tested and certified by Dell and other leading operating system and application providers.
- Recovery Systems
Recovery becomes easy and seamless with our fully managed backup services. We monitor your server to ensure your data is properly backed up and recoverable so when the time comes, you can easily repair or recover your data.
- Control Panel
We provide one of the most comprehensive customer control panels available. Providing maximum control and ease of use, our Control Panel serves as the central management point for your ASPHostPortal account. You’ll use a flexible, powerful hosting control panel that will give you direct control over your web hosting account. Our control panel and systems configuration is fully automated and this means your settings are configured automatically and instantly.
- Excellent Expertise in Technology
The reason we can provide you with a great amount of power, flexibility, and simplicity at such a discounted price is due to incredible efficiencies within our business. We have not just been providing hosting for many clients for years, we have also been researching, developing, and innovating every aspect of our operations, systems, procedures, strategy, management, and teams. Our operations are based on a continual improvement program where we review thousands of systems, operational and management metrics in real-time, to fine-tune every aspect of our operation and activities. We continually train and retrain all people in our teams. We provide all people in our teams with the time, space, and inspiration to research, understand, and explore the Internet in search of greater knowledge. We do this while providing you with the best hosting services for the lowest possible price.
- Data Center
ASPHostPortal modular Tier-3 data center was specifically designed to be a world-class web hosting facility totally dedicated to uncompromised performance and security
- Monitoring Services
From the moment your server is connected to our network it is monitored for connectivity, disk, memory and CPU utilization – as well as hardware failures. Our engineers are alerted to potential issues before they become critical.
- Network
ASPHostPortal has architected its network like no other hosting company. Every facet of our network infrastructure scales to gigabit speeds with no single point of failure.
- Security
Network security and the security of your server are ASPHostPortal’s top priorities. Our security team is constantly monitoring the entire network for unusual or suspicious behavior so that when it is detected we can address the issue before our network or your server is affected.
- Support Services
Engineers staff our data center 24 hours a day, 7 days a week, 365 days a year to manage the network infrastructure and oversee top-of-the-line servers that host our clients’ critical sites and services.



ASP.NET 4.5 Hosting - ASPHostPortal :: New Features in ASP.NET 4.5

clock October 20, 2011 07:24 by author Jervis

Another major release in .NET Framework, .NET 4.5 which allows the developers to use Windows 8 technologies and windows runtime directly from .NET 4.5. It makes easy and natural to write Metro style applications using C# and VB. .NET 4.5 makes your applications run faster eg: Faster ASP.NET startup. .NET 4.5 gives  you easy access to your data with entity framework code first approach and recent SQL Server features. This post discuss these features in detail.

You can download the .NET FW  4.5 Developer preview from
here.

ASP.NET 4.5 with ASPHostPortal Coming Soon



Press Release - ASPHostPortal Offers Silverlight 5 Hosting For All New and Existing Customer

clock October 19, 2011 05:44 by author Jervis

ASPHostPortal is a premiere web hosting company that specialized in Windows and ASP.NET-based hosting. Today, we are proud to introduce our new Microsoft product, Silverlight 5 Hosting to all our new and existing customer. For more information about this new product, please visit ASPHostPortal official website at http://www.asphostportal.com.

Silverlight 5 adds more than 40 features to the platform, with additions for both premium content viewers and developers.

Silverlight 5 provides advances in rich media and application development. For media experiences, Silverlight 5 will add GPU-accelerated video decoding to reduce the load on the CPU when streaming HD video. This will allow even netbooks to stream 1080p HD video. Microsoft Silverlight 5 beta also offers a new Microsoft XNA-based interface for delivering stunning 3-D visualizations within applications, along with a host of new features that are designed to enhance developer productivity and end-user experiences.

And the Silverlight TrickPlay feature provides the possibility to play videos at different speeds, it also supports fast-forwarding and rewinding. In addition to all of the above, the new Silverlight 5 will be featuring wireless control of all the media contents by making use of remote controllers.

“We are really excited, we really thankful for our team that works very great. This new features are really amazing.” Said Robert Kruger, CEO of ASPHostPortal.com.

For more details about this product, please visit http://asphostportal.com/Cheap-Silverlight-5-Hosting.aspx.

About ASPHostPortal.com:

ASPHostPortal.com is a hosting company that best support in Windows and ASP.NET-based hosting. ASPHostPortal.com have many great plans that can meet your business requirement. For more details about ASPHostPortal.com, please visit the official site at
http://www.asphostportal.com.



ASP.NET 4 Hosting - ASPHostPortal :: How to Solve ValidateRequest="false" in ASP.NET 4

clock October 10, 2011 07:05 by author Jervis

This is an error message that sometimes you can find when you upgrade your .net version to ASP.NET 4.0:

“A potentially dangerous Request.Form value was detected from the client”


Exception Details: System.Web.HttpRequestValidationException: A potentially dangerous Request.Form value was detected from the client

Surprisingly, you will still see this exception even if you have set ValidateRequest to false in either the Page Tag or Web.Config.

ValidateRequest="false" or  <pages validateRequest="false" />

This may end you being freak out identifying the problem.

The solution is perhaps very simple. I would recommend to go and read
ASP.NET 4 Breaking Changes.

“In ASP.NET 4, by default, request validation is enabled for all requests, because it is enabled before the BeginRequest phase of an HTTP request. As a result, request validation applies to requests for all ASP.NET resources, not just .aspx page requests. This includes requests such as Web service calls and custom HTTP handlers. Request validation is also active when custom HTTP modules are reading the contents of an HTTP request.and therefore request validation errors might now occur for requests that previously did not trigger errors.”

In order to revert to the behavior we had previously, you need to add the following setting in Web.config file:

<httpRuntime requestValidationMode="2.0"/>

Hope it help!

Reasons why you must trust ASPHostPortal.com

Every provider will tell you how they treat their support, uptime, expertise, guarantees, etc., are. Take a close look. What they’re really offering you is nothing close to what ASPHostPortal does. You will be treated with respect and provided the courtesy and service you would expect from a world-class web hosting business.

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:

-
DELL Hardware
Dell hardware is engineered to keep critical enterprise applications running around the clock with clustered solutions fully tested and certified by Dell and other leading operating system and application providers.
- Recovery Systems
Recovery becomes easy and seamless with our fully managed backup services. We monitor your server to ensure your data is properly backed up and recoverable so when the time comes, you can easily repair or recover your data.
- Control Panel
We provide one of the most comprehensive customer control panels available. Providing maximum control and ease of use, our Control Panel serves as the central management point for your ASPHostPortal account. You’ll use a flexible, powerful hosting control panel that will give you direct control over your web hosting account. Our control panel and systems configuration is fully automated and this means your settings are configured automatically and instantly.
- Excellent Expertise in Technology
The reason we can provide you with a great amount of power, flexibility, and simplicity at such a discounted price is due to incredible efficiencies within our business. We have not just been providing hosting for many clients for years, we have also been researching, developing, and innovating every aspect of our operations, systems, procedures, strategy, management, and teams. Our operations are based on a continual improvement program where we review thousands of systems, operational and management metrics in real-time, to fine-tune every aspect of our operation and activities. We continually train and retrain all people in our teams. We provide all people in our teams with the time, space, and inspiration to research, understand, and explore the Internet in search of greater knowledge. We do this while providing you with the best hosting services for the lowest possible price.
- Data Center
ASPHostPortal modular Tier-3 data center was specifically designed to be a world-class web hosting facility totally dedicated to uncompromised performance and security
- Monitoring Services
From the moment your server is connected to our network it is monitored for connectivity, disk, memory and CPU utilization – as well as hardware failures. Our engineers are alerted to potential issues before they become critical.
- Network
ASPHostPortal has architected its network like no other hosting company. Every facet of our network infrastructure scales to gigabit speeds with no single point of failure.
- Security
Network security and the security of your server are ASPHostPortal’s top priorities. Our security team is constantly monitoring the entire network for unusual or suspicious behavior so that when it is detected we can address the issue before our network or your server is affected.
- Support Services
Engineers staff our data center 24 hours a day, 7 days a week, 365 days a year to manage the network infrastructure and oversee top-of-the-line servers that host our clients’ critical sites and services.



ASP.NET 4 Hosting - ASPHostPortal :: How to Create Cookies in ASP.NET?

clock October 6, 2011 08:55 by author Jervis

Now, I will show you how to create cookies in ASP.NET. Do you know cookies? A Cookie is a small amount of text that attached to the requet and response in between browser and the server. This small amount of text can be read by the application whenever user browse the it.

Here we go, create your ASPX page

<asp:Button ID="btnCreate" runat="server" Text="Create Cookie - One way" OnClick="CreateCookie1" />
<asp:Button ID="Button1" runat="server" Text="Create Cookie - Other way" OnClick="CreateCookie2" />

In the above code snippet, we have two buttons that calls CreateCookie1 and CreateCookie2
server side method respectively. Here we are trying to show two different ways to create cookie using ASP.NET. You can use anyone of them.

Code behind

protected void CreateCookie1(object sender, EventArgs e)

{
string cookieValue = "Cookie Value 1 ";
HttpCookie cookie = new HttpCookie("CookieKey1", cookieValue);
Response.Cookies.Add(cookie);
}
protected void CreateCookie2(object sender, EventArgs e)
{
string cookieValue = "Cookie Value 2 ";
Response.Cookies["CookieKey2"].Value = cookieValue;
}

I give 2 method here:

1. In this method, we are declaring a string variable with value that we will store into the cookie. Then we are instantiating the
HttpCookie object by passing the cookie name and value to store. At last we are calling the Response.Cookies.Add method by passing the HttpCookie object to create the cookie into the user browser.

2. In this method, we are declaring a string variable with value to store into the cookie and using the Response.Cookies collection to set the cookie value by passing the cookie name to create. In this case, we do not need to explicitly call the Add method of the Response.Cookies.

This is an Output



After running the above url, press F12 (in IE 9) to open the developer tools and then click on Cache > View Cookie Information menu to display the above output. Happy coding!!

Reasons why you must trust ASPHostPortal.com

Every provider will tell you how they treat their support, uptime, expertise, guarantees, etc., are. Take a close look. What they’re really offering you is nothing close to what ASPHostPortal does. You will be treated with respect and provided the courtesy and service you would expect from a world-class web hosting business.

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:

-
DELL Hardware
Dell hardware is engineered to keep critical enterprise applications running around the clock with clustered solutions fully tested and certified by Dell and other leading operating system and application providers.
- Recovery Systems
Recovery becomes easy and seamless with our fully managed backup services. We monitor your server to ensure your data is properly backed up and recoverable so when the time comes, you can easily repair or recover your data.
- Control Panel
We provide one of the most comprehensive customer control panels available. Providing maximum control and ease of use, our Control Panel serves as the central management point for your ASPHostPortal account. You’ll use a flexible, powerful hosting control panel that will give you direct control over your web hosting account. Our control panel and systems configuration is fully automated and this means your settings are configured automatically and instantly.
- Excellent Expertise in Technology
The reason we can provide you with a great amount of power, flexibility, and simplicity at such a discounted price is due to incredible efficiencies within our business. We have not just been providing hosting for many clients for years, we have also been researching, developing, and innovating every aspect of our operations, systems, procedures, strategy, management, and teams. Our operations are based on a continual improvement program where we review thousands of systems, operational and management metrics in real-time, to fine-tune every aspect of our operation and activities. We continually train and retrain all people in our teams. We provide all people in our teams with the time, space, and inspiration to research, understand, and explore the Internet in search of greater knowledge. We do this while providing you with the best hosting services for the lowest possible price.
- Data Center
ASPHostPortal modular Tier-3 data center was specifically designed to be a world-class web hosting facility totally dedicated to uncompromised performance and security
- Monitoring Services
From the moment your server is connected to our network it is monitored for connectivity, disk, memory and CPU utilization – as well as hardware failures. Our engineers are alerted to potential issues before they become critical.
- Network
ASPHostPortal has architected its network like no other hosting company. Every facet of our network infrastructure scales to gigabit speeds with no single point of failure.
- Security
Network security and the security of your server are ASPHostPortal’s top priorities. Our security team is constantly monitoring the entire network for unusual or suspicious behavior so that when it is detected we can address the issue before our network or your server is affected.
- Support Services
Engineers staff our data center 24 hours a day, 7 days a week, 365 days a year to manage the network infrastructure and oversee top-of-the-line servers that host our clients’ critical sites and services.



Coming Soon - ASPHostPortal Will Support ASP.NET 4.5 Hosting.

clock October 4, 2011 08:01 by author Jervis

ASPHostPortal.com, the leader in ASP.NET and Windows Hosting Provider, proudly announces that we will support ASP.NET 4.5 Hosting. As of this date, the ASP.NET 4.5 is still in Developer Preview mode and it has not been officially released by Microsoft yet. However, once it is fully released, we will certainly make it available on our server.

ASP.NET 4.5 Core Services

The following lists new features for core ASP.NET functionality:

- Asynchronously reading and writing HTTP requests and responses - Application Lifecycle Management (ALM) crosses many roles within an organization and traditionally not every one of the roles has been an equal player in the process. Visual Studio Team System 2010 continues to build the platform for functional equality and shared commitment across an organization’s ALM process.

- Support for reading unvalidated request data when request validation is enabled - Every year the industry develops new technologies and new trends. With Visual Studio 2010 and .NET Framework 4.5, Microsoft delivers tooling and framework support for the latest innovations in application architecture, development and deployment.

- Support for WebSockets protocol - Every year the industry develops new technologies and new trends. With Visual Studio 2010 and .NET Framework 4.5, Microsoft delivers tooling and framework support for the latest innovations in application architecture, development and deployment.

- Bundling and minification of client scripts - Every year the industry develops new technologies and new trends. With Visual Studio 2010 and .NET Framework 4.5, Microsoft delivers tooling and framework support for the latest innovations in application architecture, development and deployment.

- Support for asynchronous modules and handlers - Every year the industry develops new technologies and new trends. With Visual Studio 2010 and .NET Framework 4.5, Microsoft delivers tooling and framework support for the latest innovations in application architecture, development and deployment.

- Integrated Anti-XSS encoding routines - Every year the industry develops new technologies and new trends. With Visual Studio 2010 and .NET Framework 4.5, Microsoft delivers tooling and framework support for the latest innovations in application architecture, development and deployment.

Reasons why you must trust ASPHostPortal.com

Every provider will tell you how they treat their support, uptime, expertise, guarantees, etc., are. Take a close look. What they’re really offering you is nothing close to what ASPHostPortal does. You will be treated with respect and provided the courtesy and service you would expect from a world-class web hosting business.

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:

-
DELL Hardware
Dell hardware is engineered to keep critical enterprise applications running around the clock with clustered solutions fully tested and certified by Dell and other leading operating system and application providers.
- Recovery Systems
Recovery becomes easy and seamless with our fully managed backup services. We monitor your server to ensure your data is properly backed up and recoverable so when the time comes, you can easily repair or recover your data.
- Control Panel
We provide one of the most comprehensive customer control panels available. Providing maximum control and ease of use, our Control Panel serves as the central management point for your ASPHostPortal account. You’ll use a flexible, powerful hosting control panel that will give you direct control over your web hosting account. Our control panel and systems configuration is fully automated and this means your settings are configured automatically and instantly.
- Excellent Expertise in Technology
The reason we can provide you with a great amount of power, flexibility, and simplicity at such a discounted price is due to incredible efficiencies within our business. We have not just been providing hosting for many clients for years, we have also been researching, developing, and innovating every aspect of our operations, systems, procedures, strategy, management, and teams. Our operations are based on a continual improvement program where we review thousands of systems, operational and management metrics in real-time, to fine-tune every aspect of our operation and activities. We continually train and retrain all people in our teams. We provide all people in our teams with the time, space, and inspiration to research, understand, and explore the Internet in search of greater knowledge. We do this while providing you with the best hosting services for the lowest possible price.
- Data Center
ASPHostPortal modular Tier-3 data center was specifically designed to be a world-class web hosting facility totally dedicated to uncompromised performance and security
- Monitoring Services
From the moment your server is connected to our network it is monitored for connectivity, disk, memory and CPU utilization – as well as hardware failures. Our engineers are alerted to potential issues before they become critical.
- Network
ASPHostPortal has architected its network like no other hosting company. Every facet of our network infrastructure scales to gigabit speeds with no single point of failure.
- Security
Network security and the security of your server are ASPHostPortal’s top priorities. Our security team is constantly monitoring the entire network for unusual or suspicious behavior so that when it is detected we can address the issue before our network or your server is affected.
- Support Services
Engineers staff our data center 24 hours a day, 7 days a week, 365 days a year to manage the network infrastructure and oversee top-of-the-line servers that host our clients’ critical sites and services.



ASP.NET 4 Hosting - ASPHostPortal :: How to Solve - Unable to start debugging on the web server. The web server is not configured correctly

clock October 3, 2011 06:56 by author Jervis

In this post I will show you how to fix unable to start debugging on the web server. The web server is not configured correctly. 

"Unable to start debugging on the web server.  The web server is not configured correctly.  See help for common configuration errors.  Running the web page outside of the debugger may provide further information."

Here are 5 solutions to solve the issue and I hope it will help you that find this problem.

Solution 1

In this method first check your particular website has started or not if not start your website.


Open you’re IIS and select your particular website right click on that site and select Manage WebSite under that click start option.



Test it and see how it work or not. If don’t, you need to find another solution.

Solution 2

1. Open IIS and now select your application ---> Right click on that application and select Properties
2. Now one window will open in that Select Directory tab ---> under that select Application settings  ---> Click on “Create” button (Once it created that button text will change to “Remove”)
3. After that click Apply and click OK button.
4. If you’re using IIS7 no need to do the first and second steps just select your application and right click on it and select option “Convert to Application”



Then, try it again. I hope it will work fine otherwise you will see another solution.

Solution 3

1) Open  IIS

2) Select your website and right click and go to properties
3) After that select  Asp.net tab
4) Under that click on Edit Configuration
5) Select Application Tab
6) Under Select C# as default language and check the Enable Debugging checkbox

Some times that default language was set to vb. After set the above properties run your application now it will work for you  Still if it doesn’t work for your follow another method.

Solution 4

Open the command prompt and run ASPNET_REGIIS.EXE with -i parameter

C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\aspnet_regiis –i

Solution 5

1) Right click on your project in VS2005 or VS2008 or VS2010.

2) Click on Properties
3) Click on Web tab
4) Under Servers, click on the radio button Use Visual Studio Development Server
5) Check Auto Assign Port radio button

6) Uncheck NTLM Authentication and Enable Edit and Continue

I hope this time will work for you. Good luck and enjoy this tutorial.

Reasons why you must trust ASPHostPortal.com

Every provider will tell you how they treat their support, uptime, expertise, guarantees, etc., are. Take a close look. What they’re really offering you is nothing close to what ASPHostPortal does. You will be treated with respect and provided the courtesy and service you would expect from a world-class web hosting business.

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:

-
DELL Hardware
Dell hardware is engineered to keep critical enterprise applications running around the clock with clustered solutions fully tested and certified by Dell and other leading operating system and application providers.
- Recovery Systems
Recovery becomes easy and seamless with our fully managed backup services. We monitor your server to ensure your data is properly backed up and recoverable so when the time comes, you can easily repair or recover your data.
- Control Panel
We provide one of the most comprehensive customer control panels available. Providing maximum control and ease of use, our Control Panel serves as the central management point for your ASPHostPortal account. You’ll use a flexible, powerful hosting control panel that will give you direct control over your web hosting account. Our control panel and systems configuration is fully automated and this means your settings are configured automatically and instantly.
- Excellent Expertise in Technology
The reason we can provide you with a great amount of power, flexibility, and simplicity at such a discounted price is due to incredible efficiencies within our business. We have not just been providing hosting for many clients for years, we have also been researching, developing, and innovating every aspect of our operations, systems, procedures, strategy, management, and teams. Our operations are based on a continual improvement program where we review thousands of systems, operational and management metrics in real-time, to fine-tune every aspect of our operation and activities. We continually train and retrain all people in our teams. We provide all people in our teams with the time, space, and inspiration to research, understand, and explore the Internet in search of greater knowledge. We do this while providing you with the best hosting services for the lowest possible price.
- Data Center
ASPHostPortal modular Tier-3 data center was specifically designed to be a world-class web hosting facility totally dedicated to uncompromised performance and security
- Monitoring Services
From the moment your server is connected to our network it is monitored for connectivity, disk, memory and CPU utilization – as well as hardware failures. Our engineers are alerted to potential issues before they become critical.
- Network
ASPHostPortal has architected its network like no other hosting company. Every facet of our network infrastructure scales to gigabit speeds with no single point of failure.
- Security
Network security and the security of your server are ASPHostPortal’s top priorities. Our security team is constantly monitoring the entire network for unusual or suspicious behavior so that when it is detected we can address the issue before our network or your server is affected.
- Support Services
Engineers staff our data center 24 hours a day, 7 days a week, 365 days a year to manage the network infrastructure and oversee top-of-the-line servers that host our clients’ critical sites and services.



ASP.NET 4 Hosting - ASPHostPortal :: Parallel.For Loop in .NET 4

clock September 28, 2011 08:19 by author Jervis

Do you have a multiprocessor system? Then, Right click on taskbar and open task manager and click the Performance Tab and notice the performance. You will find something like shown below:



This means there are cores not fully utilized for best performance.

Sequential For loop

for (int i = 0; i < 100; i++)
{
        //Code though independent in each iterations executes sequentially
        a[i] = a[i]*a[i];
}


Multicore-processors machines are now becoming standard. The key to performance improvements is therefore to run a program on multiple processors in parallel.

Introducing TPL

The Task Parallel Library (TPL) is designed to make it much easier for the developer to write code that can automatically use multiple processors. Using the library, you can conveniently express potential parallelism in existing sequential code, where the exposed parallel tasks will be run concurrently on all available processors. Usually this results in significant speedups.

TPL is a major component of the Parallel FX library, the next generation of concurrency support for the Microsoft .NET Framework.

Since the iterations are independent of each other, that is, subsequent iterations do not read state updates made by prior iterations, you can use TPL to run each iteration in parallel on available cores, like this:

Parallel For loop

Parallel.For(0, 100, i =>
                {
                        //This block should contain independent code
                        //It must not update/use value of some variable in
                        //this block from previous iteration
                        //This block should contain a code that takes a huge       
                        //execution time in each iteration
                        //Small complexity code here can result in poor performance
                        a[i] = a[i]*a[i];
                }
            );



ASP.NET 4 Hosting - ASPHostPortal :: How to use Microsoft Enterprise Library in asp.net for data access?

clock September 23, 2011 08:06 by author Jervis

Microsoft Enterprise Library is a collection of reusable software components used for  logging, validation, data access, exception handling etc.

Here I am describing how to use Microsoft Enterprise Library for data access.

Step 1: First download the project from
http://entlib.codeplex.com/ URL.
Step 2: Now extract the project to get

Microsoft.Practices.EnterpriseLibrary.Common.dll
Microsoft.Practices.EnterpriseLibrary.Configuration.Design.dll
Microsoft.Practices.EnterpriseLibrary.Data.dll
Microsoft.Practices.ObjectBuilder.dll


And give reference in the Bin directory by Right click on Bin -> Add Reference -> then give the path of these 4 dlls. Then

Step 3: Modification in the web.config for Connection String.

<add name="ASPHostPortalConnection" providerName="System.Data.SqlClient" connectionString="DataSource=ASPHostPortalSQLEXPRESS;Initial Catalog=ASPHostPortal;User ID=sa;Password=admintest;Min Pool Size=10;Max Pool Size=100;Connect Timeout=100"/>


Give the connection string as above where Datasource is your data source name, Initial Catalog is your database name and User ID and Password as in your sql server.

Step 4:

Now it is time to write the code.


Write the below 2 lines in the using block.

using System.Data.Common;
using Microsoft.Practices.EnterpriseLibrary.Data;

Here I am writting some examples how to work on:

public DataTable Read()
    {
        try
        {
            Database db = DatabaseFactory.CreateDatabase("ASPHostPortalConnection");
            DbCommand dbCommand = db.GetStoredProcCommand("[Topics_Return]");
            DataSet dataSet = db.ExecuteDataSet(dbCommand);
            return dataSet.Tables[0];
        }
        catch
        {
            return null;
        }
    }

The above code is a sample that will return a dataset. Here Fewlines4bijuConnection is the connection name and Topics_Return is the stored procedure name that is nothing but a Select statement.

But if the stored procedure is taking parameter then the code will be like:

 public int Save()
    {
        Database db = DatabaseFactory.CreateDatabase("ASPHostPortalConnection");
        DbCommand dbCommand = db.GetStoredProcCommand("Topics_Save");

        db.AddInParameter(dbCommand, "@Subject", DbType.AnsiString, "Here is the subject");
        db.AddInParameter(dbCommand, "@Description", DbType.AnsiString, "Here is the Descriptiont");      
        db.AddInParameter(dbCommand, "@PostedBy", DbType.Int32, 4);       
        db.AddOutParameter(dbCommand, "@Status", DbType.AnsiString, 255);
        try
        {
            db.ExecuteNonQuery(dbCommand);
            return Convert.ToInt32(db.GetParameterValue(dbCommand, "Status"));
        }
        catch
        {
            return 0;
        }
    }

As the code explained above ASPHostPortalConnection is the connection name and Topics_Save is the stored procedure name that is taking 3 (Subject,Description,PostedBy) input parameters and 1(Status) output parameter.

You may give values from textbox, I am here provideing sample values like  "Here is the subject", "Here is the Descriptiont" or you may give the UserID from session, I am here giving 4. The output parameter will give you a string as defined and the code to get the value is

int returnValue=Convert.ToInt32(db.GetParameterValue(dbCommand, "Status"));

you can pass input parameter as below

db.AddInParameter(dbCommand, "@Subject", DbType.AnsiString, "Here is the subject");

DbType.AnsiString since Subject is of string time, you can select different values like AnsiString, DateTime from the Enum as be the parameter type.

The above code describes if you are using any stored procedure.

Below is an example that shows how to use inline SQL statements.

public DataSet GetID(string title)
    {
       DataSet ds=new DataSet();

        try
        {
            Database db = DatabaseFactory.CreateDatabase("ASPHostPortalConnection");
            DbCommand dbCommand = db.GetSqlStringCommand("Select * FROM Topics where UserID=1 and
IsDeleted=0");          
            ds= db.ExecuteDataSet(dbCommand);
           return ds;          

        }
        catch
        {
            return ds;
        }
         return ds;
    }


Happy coding!!

Reasons why you must trust ASPHostPortal.com

Every provider will tell you how they treat their support, uptime, expertise, guarantees, etc., are. Take a close look. What they’re really offering you is nothing close to what ASPHostPortal does. You will be treated with respect and provided the courtesy and service you would expect from a world-class web hosting business.

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:

-
DELL Hardware
Dell hardware is engineered to keep critical enterprise applications running around the clock with clustered solutions fully tested and certified by Dell and other leading operating system and application providers.
- Recovery Systems
Recovery becomes easy and seamless with our fully managed backup services. We monitor your server to ensure your data is properly backed up and recoverable so when the time comes, you can easily repair or recover your data.
- Control Panel
We provide one of the most comprehensive customer control panels available. Providing maximum control and ease of use, our Control Panel serves as the central management point for your ASPHostPortal account. You’ll use a flexible, powerful hosting control panel that will give you direct control over your web hosting account. Our control panel and systems configuration is fully automated and this means your settings are configured automatically and instantly.
- Excellent Expertise in Technology
The reason we can provide you with a great amount of power, flexibility, and simplicity at such a discounted price is due to incredible efficiencies within our business. We have not just been providing hosting for many clients for years, we have also been researching, developing, and innovating every aspect of our operations, systems, procedures, strategy, management, and teams. Our operations are based on a continual improvement program where we review thousands of systems, operational and management metrics in real-time, to fine-tune every aspect of our operation and activities. We continually train and retrain all people in our teams. We provide all people in our teams with the time, space, and inspiration to research, understand, and explore the Internet in search of greater knowledge. We do this while providing you with the best hosting services for the lowest possible price.
- Data Center
ASPHostPortal modular Tier-3 data center was specifically designed to be a world-class web hosting facility totally dedicated to uncompromised performance and security
- Monitoring Services
From the moment your server is connected to our network it is monitored for connectivity, disk, memory and CPU utilization – as well as hardware failures. Our engineers are alerted to potential issues before they become critical.
- Network
ASPHostPortal has architected its network like no other hosting company. Every facet of our network infrastructure scales to gigabit speeds with no single point of failure.
- Security
Network security and the security of your server are ASPHostPortal’s top priorities. Our security team is constantly monitoring the entire network for unusual or suspicious behavior so that when it is detected we can address the issue before our network or your server is affected.
- Support Services
Engineers staff our data center 24 hours a day, 7 days a week, 365 days a year to manage the network infrastructure and oversee top-of-the-line servers that host our clients’ critical sites and services.



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