Windows 2012 Hosting - MVC 6 and SQL 2014 BLOG

Tutorial and Articles about Windows Hosting, SQL Hosting, MVC Hosting, and Silverlight Hosting

ASP.NET MVC Hosting - ASPHostPortal :: How to Integrate ASP.NET MVC with Facebook

clock September 27, 2011 08:45 by author Jervis

If you are a Facebook Application developer working classical ASP.NET, you are probably familiar with the Facebook Developer Toolkit. This tool comes with a great set of server side controls that ease a lot of the developer’s job. But if you are like me and that you want to enjoy ASP.NET MVC, then you cannot use those server side controls that easily, so MVC Addon project might be of great help. The MVC Addon will help overcome differences in the rendering and resource requesting differences between classical ASP.NET and ASP.NET MVC.

But when it comes to integrating Facebook Connect with ASP.NET MVC, a few things need to be changed from steps explained in classical ASP.NET tutorials. This article is about overcoming those difficulties. So lets get started.

First, you will need to add the following code to your Site.Master file:

<html xmlns="http://www.w3.org/1999/xhtml" xmlns:fb="http://www.facebook.com/2008/fbml">
<script src=http://static.ak.connect.facebook.com/js/api_lib/v0.4/FeatureLoader.js.php
    type="text/javascript">
</script

<script src="/Scripts/fbconnect.js" type="text/javascript"></script>

<script type="text/javascript">
    FB.init("YOU_API_KEY", "xd_receiver");
</
script>

Then, you should create a new controller called ‘xd_receiver’ and add the following code to its Index View (which should not derive from the master page):

<%@ Page Language="C#" Inherits="System.Web.Mvc.ViewPage" %> 

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
<title>Cross-Domain Receiver Page</title>
</head>
<body>
<script src="http://static.ak.facebook.com/js/api_lib/v0.4/XdCommReceiver.js?v2" type="text/javascript"></script>
</body>
</html>

Finally, you should add the following code to render the Facebook Connect login button:

<fb:login-button onlogin="facebook_onlogin_ready();"></fb:login-button>

We’re done! When the user clicks on the Facebook Connect button, the Facebook login window pops up. After the user has entered the login information, the pop up closes and your website’s browser window will refresh. From here you can start reading the cookie for the user information and other stuff.

Hope this tutorial can 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 MVC 3 Hosting - ASPHostPortal :: How to Add MVC 3 Features to An Existing ASP.NET Web Forms - Part 2

clock September 23, 2011 06:40 by author Jervis

This is in continuation with Part 1 of the article, so you may want to check it out before reading this, in case you haven’t already.

Next, we need to enable the Global.asax.  We will open up the Global.asax and add the following two references in the namespaces section

using System.Web.Mvc;
using System.Web.Routing;


We need to then add the RegisterRoutes method which is a default in MVC projects.  So we will add this method to the Global.asax

public static void RegisterRoutes(RouteCollection routes)
        {
            routes.IgnoreRoute("{resource}.axd/{*pathInfo}");

            routes.MapRoute(
                "Default", // Route name
                "{controller}/{action}/{id}", // URL with parameters
                new { controller = "Home", action = "Index", id = UrlParameter.Optional } // Parameter defaults
            );

        }

Then, we need to call this method in the Application_Start event of the Global.asax.


RegisterRoutes(RouteTable.Routes);

Now, we would create folders called “Controllers” and “Views” in the root of the application. But, if we right click on the “Controllers” folder and try to add a new Controller, it doesn’t show up in the templates.  We still need to enable one setting in Visual Studio.  The default Project properties' ProjectTypeGuids section doesn't have the ProjectTypeGuid for MVC included.  This will be used by Visual Studio uses to identify the templates to show in the project.

So, to edit that, first, we need to “unload” the project.  Now, if you haven’t enabled Visual Studio to always show the Solution file (Tools – Options – Projects and Solutions – Always Show Solution), and if there is only this project (that we created) we would not be able to unload the project since the solution file wouldn't show up in the Solution Explorer.  Once you do the above step, it will show the solution file within the Project hierarchy.  Then we would be able to chose the Project file and chose – “Unload Project”



After that we can edit the project file by right clicking on the project and select “Edit HybridWebApp.csproj"



It opens up the Project file in Visual Studio.  In that, we will add a key value to make sure MVC 3 tooling is enabled.  So, identify and replace the section with the following

<ProjectTypeGuids>{E53F8FEA-EAE0-44A6-8774-FFD645390401};{349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids>

Basically I have added the highlighted value to the setting, which is specific to MVC3.

Once we are done, we can close the file, select “HybridWebApp” and chose “Reload Project”



Once this is done, we can right click on the Controllers folder and select “Add” it lists “Controller”



We will give this Controller, the name “ProductsController”



In the Controller created, we will add reference to the Model that we created, in the using section as follows:

using HybridWebApp.Models;

Also, we need to create a handle for the Entity model generated, as follows:-

NorthwindEntities nw = new NorthwindEntities();

After this, we will modify the default “Index” view generated to retrieve a list of products, as follows:-

public ActionResult Index()
        {
            var productList = from pList in nw.Products
                          select pList;


            return View(productList);
        }

We can now right click on the Controller and select “Add View”



It would prompt the View configuration screen where we can select that this would be a strongly-typed view and would be based on the Product entity and the Scaffold template would be “List”



One thing we need to do still is that, inside the “Views” folder there needs to be a config file.  So, right click Views folder and select “Add – New Item”



and in the “Add New Item” screen search for “config” in the top right search box.  It would list the Web Configuration template and we can chose that to add



Once we add that, we can create another simple MVC3 application or use an existing MVC3 application and navigate to the Views folder to open the web.config file.  From there we can copy the contents of the config file into our newly created config file under the Views folder in our HybridWebApp.  The settings are as follows

<?xml version="1.0"?>

<configuration>
  <configSections>
    <sectionGroup name="system.web.webPages.razor" type="System.Web.WebPages.Razor.Configuration.RazorWebSectionGroup, System.Web.WebPages.Razor, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
      <section name="host" type="System.Web.WebPages.Razor.Configuration.HostSection, System.Web.WebPages.Razor, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" />
      <section name="pages" type="System.Web.WebPages.Razor.Configuration.RazorPagesSection, System.Web.WebPages.Razor, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" />
    </sectionGroup>
  </configSections>

  <system.web.webPages.razor>
    <host factoryType="System.Web.Mvc.MvcWebRazorHostFactory, System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
    <pages pageBaseType="System.Web.Mvc.WebViewPage">
      <namespaces>
        <add namespace="System.Web.Mvc" />
        <add namespace="System.Web.Mvc.Ajax" />
        <add namespace="System.Web.Mvc.Html" />
        <add namespace="System.Web.Routing" />
      </namespaces>
    </pages>
  </system.web.webPages.razor>

  <appSettings>
    <add key="webpages:Enabled" value="false" />
  </appSettings>

  <system.web>
    <httpHandlers>
      <add path="*" verb="*" type="System.Web.HttpNotFoundHandler"/>
    </httpHandlers>

    <!--
        Enabling request validation in view pages would cause validation to occur
        after the input has already been processed by the controller. By default
        MVC performs request validation before a controller processes the input.
        To change this behavior apply the ValidateInputAttribute to a
        controller or action.
    -->
    <pages
        validateRequest="false"
        pageParserFilterType="System.Web.Mvc.ViewTypeParserFilter, System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"
        pageBaseType="System.Web.Mvc.ViewPage, System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"
        userControlBaseType="System.Web.Mvc.ViewUserControl, System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
      <controls>
        <add assembly="System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" namespace="System.Web.Mvc" tagPrefix="mvc" />
      </controls>
    </pages>
  </system.web>

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

    <handlers>
      <remove name="BlockViewHandler"/>
      <add name="BlockViewHandler" path="*" verb="*" preCondition="integratedMode" type="System.Web.HttpNotFoundHandler" />
    </handlers>
  </system.webServer>
</configuration>

After we have copied the above and saved our newly created config file, we will be good to go.


Note that, the Product/Index.cshtml created provides the default List template taking the columns as is from the Product Entity.

We can customize and remove columns such as ID that we don’t need from listing.  Also, we can customize the HTML layout.  But, for the sake of this post, we will leave it as is.

One last step that we want to do is open the “Site.Master” of our HybridWebApp and you will find the
Menu section in the page.  We will edit the menu section to read as follows:-




Once we save all our files -  Build and run the app using F5, we will first encounter the Home Page where we list the Categories using Webforms.



Now, when you click on the “Products” menu this would open up the products listing page running out of MVC



So, we are now running one page in Web Forms and the other one using MVC.  We can customize the UI etc.,to make it look better.

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 MVC 3 Hosting - ASPHostPortal :: How to Add MVC 3 Features to An Existing ASP.NET Web Forms - Part 1

clock September 22, 2011 07:43 by author Jervis

To begin with, we will create a Web Forms application (ASP.NET 4) using Visual Studio 2010. So, a File – New – Web Application and giving it a name HybridWebApp.



We would create a folder “Models” in the root directory where we would be adding our Entity Model. To begin, we will use a Database. For the purpose of this demo, I would be using the NorthWind sample database which can be downloaded from
here

We will add an ADO.NET Entity Data Model into our application and give it a name NorthWindModel



Through the wizard, we connect to the NorthWind sample database and chose the tables “Products”, “Categories” and “Suppliers” and then complete the wizard to generate the ADO.NET Entity Model.



So once we rebuild the solution, we have the schema ready. Next, we can wire up this data into a web page using a GridView control. We will use the Default.aspx page created automatically to place the GridView and then using the GridView’s binding UI, try and bind to the TechEd Entity that we just created.







Finally chose in the GridView the binding option to “Edit”, “Select” etc., and complete the wizard. With this our data binding with Web Forms is done and we have a page where we can see the Categories Listing.



Next, we want to add to this, an MVC Application. To do that we need to implement the following:-

1. Reference the MVC, Routing & WebPages assemblies in the Project
2. Reference the assemblies in the web.config file
3. Add the Routing mechanism to the Global.asax
4. Enable tooling support in Visual Studio for MVC (since this is a Web Form application)
5. Create the Controllers/Views for displaying data

So, first, we need to add Reference to the System.Web.Mvc which is installed typically in the C:\Program Files\Microsoft ASP.NET\ASP.NET MVC3\Assemblies folder. Also, we need to add Reference to the System.Web.Razor, System.Web.Helpers, System.Web.WebPages and the System.Web.WebPages.Razor DLLs located in the C:\Program Files (x86)\Microsoft ASP.NET\ASP.NET Web Pages\v1.0\Assemblies folder.



Next, in the Web.Config file, we will add the reference to the namespaces within the <system.web> tags

<pages>
<namespaces>
<add namespace="System.Web.Helpers" />
<add namespace="System.Web.Mvc" />
<add namespace="System.Web.Mvc.Ajax" />
<add namespace="System.Web.Mvc.Html" />
<add namespace="System.Web.Routing" />
<add namespace="System.Web.WebPages"/>
</namespaces>
< /pages>

After that, we will add the assemblies’ references within the <compilation> tags


<compilation debug="true" targetFramework="4.0">
<assemblies>
<add assembly="System.Web.Abstractions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<add assembly="System.Web.Helpers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<add assembly="System.Web.Routing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<add assembly="System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<add assembly="System.Web.WebPages, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<add assembly="System.Data.Entity, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
</assemblies>
</compilation>

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 MVC 3 Hosting - ASPHostPortal :: How to return 404 Http status code from ASP.NET MVC Application?

clock September 20, 2011 08:14 by author Jervis

ASP.NET MVC3 includes a new class HttpNotFoundResult in  System.Web.Mvc namespace.

HttpNotFoundResult: Instance of HttpNotFoundResult class indicates to client(browser) that the requested resource was not found. It returns a 404 HTTP status code to the client. Generally we return 404 status code if a requested webpage is not available. In case of MVC applications we return 404 status code is in terms of resources, for example we are searching for particular user profile in the portal, if the user profile is not found, we can return 404.

How to return 404 status code from a MVC application?

First way is to instantiate HttpNotFoundResult class and return the object.

public ActionResult Index()
{
var result = new HttpNotFoundResult();
return result;
}


Next alternative is to makes use of HttpNotFound() helper method of the Controller class which returns the HttpNotFoundResult instance.

public ActionResult Index()
{
return HttpNotFound();
}

We can return 404 along with custom status code description,using the overloded version of HttpNotFound(string statusDescription).

public ActionResult Index()
{
return HttpNotFound("can not find requested resource");
}

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.



SQL 2008 Hosting - ASPHostPortal :: How to Solve Could not find stored procedure dbo.aspnet_CheckSchemaVersion in ASP.NET Membership

clock September 20, 2011 06:51 by author Jervis

Server Error in '/' Application.




Could not find stored procedure 'dbo.aspnet_CheckSchemaVersion'.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Data.SqlClient.SqlException: Could not find stored procedure 'dbo.aspnet_CheckSchemaVersion'.

How to Fix it:

1. Try to recreate the Membership database (ASPNETDB), run this command on your computer:

C:\WINDOWS\Microsoft.NET\Framework\[framework version]

2. You can also check your web.config if it doesn’t solve your issue.

DataSource=.;Integrated Security=True;Initial Catalog=aspnetdb

3. Then, restart IIS.

If you have problem with your host, please contact us. We can help. You can always start from our lowest plan, PORTAL ONE to get this asp.net sql hosting.

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.



SQL 2008/2008 R2 Hosting - ASPHostPortal :: Error 53 when Connecting to SQL Management Studio

clock September 15, 2011 05:43 by author Jervis

Another error that you might find when you connected to your MSSQL 2008/2008 R2.



The above error clearly indicates that the connection couldn’t be opened. 

How to Fix it?

Earlier, SQL Azure required the servername parameter to be
[email protected]. So, change it to SERVERNAME.DATABASE.WINDOWS.NET.

Please try to connect again and you will see the magic. J

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 MVC 3 Hosting - ASPHostPortal :: How to Create a blog with JQuery Mobile and ASP.NET MVC 3 with C#

clock September 12, 2011 08:26 by author Jervis

First, I created a new project and then used the Library Package Manager to add the (Code First) Entity Framework (CTP5) to the project.










I then added a class called Post to the Models folder with the following code:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Data.Entity;
using System.ComponentModel.DataAnnotations;   

namespace MobileBlog.Models
{
    public class Post
    {
        public int ID { get; set; }
        public string Title { get; set; }
        [DataType(DataType.MultilineText)]
        public string Content { get; set; }
        public DateTime PublishDate { get; set; }
    }   

    public class PostDBContext : DbContext
    {
        public DbSet<Post> Posts { get; set; }
    }
}

This re-creates the same scheme I had for the PHP/MySQL Mobile Blog project. I also then created another class to the Models folder called PostInitializer to re-create the database and seed it with data as required. Here is the code for that class:

using System;
using System.Collections.Generic;
using System.Data.Entity.Database;   

namespace MobileBlog.Models
{
    public class PostInitializer : DropCreateDatabaseIfModelChanges<PostDBContext>
    {
        protected override void Seed(PostDBContext context)
        {
            var posts= new List<Post> {    

                 new Post { Title = "My new blog",
                             Content = "This is my first blog post...",
                             PublishDate= DateTime.Now},    

                 new Post { Title = "Second post",
                             Content = "This is my second blog post. Hi!",
                             PublishDate= DateTime.Now}
             };
            posts.ForEach(d => context.Posts.Add(d));
        }
    }
}

That requires a change to the web.config (for the connection string) and the Global.asax.cs file.

To the Application_Start() in the Global.asax.cs file I added the following line:

DbDatabase.SetInitializer<PostDBContext>(new PostInitializer());

…as well as this:

using System.Data.Entity.Database;

using MobileBlog.Models;

The connection string for the web.config file is as follows:


<connectionStrings>
  <add name="PostDBContext"
       connectionString="Server=.\SQLEXPRESS;
       Database=Posts;Trusted_Connection=true"
       providerName="System.Data.SqlClient" />
</connectionStrings>

Going into the Views/Shared folder no I modified the _Layout.cshtml file to be a good template for the project and to be in HTML5 format as well as to use the JQuery CDN to import the JQuery and JQuery Mobile frameworks.

<!DOCTYPE html>
<html lang="en-us" >
<head runat="server">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>MobileBlog</title>
    <link rel="stylesheet" href="http://code.jquery.com/mobile/1.0a3/jquery.mobile-1.0a3.min.css" />
    <script src="http://code.jquery.com/jquery-1.5.min.js"></script>
    <script src="http://code.jquery.com/mobile/1.0a3/jquery.mobile-1.0a3.min.js"></script>
</head>
<body>
    <div data-role="page">
        <div data-role="header">
            <h1>@ViewBag.HeaderString</h1>
        </div>
        <div data-role="content">
            @RenderBody()
        </div>
        <div data-role="footer"><h1>- MobileBlog -</h1></div>
    </div>
</body>
</html>

I then added a HomeController with the following code:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using MobileBlog.Models;   

namespace MobileBlog.Controllers
{
    public class HomeController : Controller
    {
        PostDBContext db = new PostDBContext();   

        public ActionResult Index()
        {
            ViewBag.HeaderString = "Welcome!";
            return View();
        }   

        public ActionResult Create()
        {
            ViewBag.HeaderString = "Create New Post";
            return View();
        }   

        public ActionResult Read()
        {
            ViewBag.HeaderString = "Read Blog";   

            var posts = from p in db.Posts
                         select p;   

            return View(posts.ToList());
        }   

        public ActionResult About()
        {
            ViewBag.HeaderString = "About MobileBlog";
            return View();
        }   

        [AcceptVerbs(HttpVerbs.Post)]
        public string SavePost(string title, string content)
        {
            Post post = new Post();
            post.Title = title;
            post.Content = content;
            post.PublishDate = DateTime.Now;   

            if (ModelState.IsValid)
            {
                db.Posts.Add(post);
                db.SaveChanges();
                return "SUCCESS";
            }
            else
            {
                return "FAILED";
            }
        }
    }
}

From that controller I generated views for the following pages: About, Create, Index, and Read.

File: About.cshtml

@{
    Layout = "~/Views/Shared/_Layout.cshtml";
}   

<div data-role="fieldcontain">
    <p><a href="http://windows2008hosting.asphostportal.com">MobileBlog</a></p>
    <p>Created by: <a href="http://twitter.com/jervis">Jervis</a></p>
    <p>Powered by: <a href="http://jquerymobile.com">JQuery Mobile</a></p>
</div>

File: Index.cshtml

@{

    Layout = "~/Views/Shared/_Layout.cshtml";
}   

<ul data-role="listview">
    <li>
        @Html.ActionLink("Create New Post", "Create")
    </li>
    <li>
        @Html.ActionLink("Read Blog", "Read")
    </li>
    <li>
        @Html.ActionLink("About MobileBlog", "About")
    </li>
</ul>

File: Create.cshtml

@model MobileBlog.Models.Post   


@{
    Layout = "~/Views/Shared/_Layout.cshtml";
}   

<script type="text/javascript">
    function resetTextFields()
    {
        $("#Title").val("");
        $("#Content").val("");
    }   

    function onSuccess(data, status)
    {
        resetTextFields();
        // Notify the user the new post was saved
        $("#notification").fadeIn(2000);
        data = $.trim(data);
        if(data == "SUCCESS")
        {
            $("#notification").css("background-color", "#ffff00");
            $("#notification").text("The post was saved");
        }
        else
        {
            $("#notification").css("background-color", "#ff0000");
            $("#notification").text(data);
        }
        $("#notification").fadeOut(5000);
    }   

    $(document).ready(function() {   

        $("form[action$='SavePost']").submit(function () {
            $.ajax({
                url: $(this).attr("action"),
                type: "post",
                data: $(this).serialize(),
                success: onSuccess
            });
            return false;
        });   

        $("#cancel").click(function(){
            resetTextFields();
        });
    });   

</script>
using (Html.BeginForm("SavePost", "Home", FormMethod.Post))
{
    <div data-role="content">
        <form id="newPostForm">
            <div data-role="fieldcontain">
                @Html.LabelFor(model => model.Title, "Post Title")
                @Html.EditorFor(model => model.Title)   

                @Html.LabelFor(model => model.Content, "Post Content")
                @Html.TextAreaFor(model => model.Content)   

                <fieldset class="ui-grid-a">
                    <div class="ui-block-a">@Html.ActionLink("Cancel", "Index", null, new { @data_role = "button" })</div>
                    <div class="ui-block-b"><button data-theme="b"
id="submit" type="submit">Submit</button></div>

                </fieldset>
                <h3 id="notification"></h3>
            </div>
        </form>
    </div>
}

File: Read.cshtml


@model IEnumerable<MobileBlog.Models.Post>   

@{
    Layout = "~/Views/Shared/_Layout.cshtml";
}   

<script type="text/javascript">
    $(document).ready(function() {
        $("#refresh").click(function(){
            location.reload();
        });
    });   

</script>   

<button data-theme="b" data-role="button" data-iconpos="left" id="refresh" type="button" data-icon="refresh">Refresh</button>
<ul data-role="listview" data-theme="d" data-inset="true">   

    @foreach (var post in Model) {
        <li><h2>@post.Title</h2>@post.Content<p class="ui-li-aside"><strong>@post.PublishDate</strong></p></li>
    }
</ul>

So the code is familiar to the PHP code in most regards. Running the project in the Android emulator I get the same results as the PHP project before. BTW, I used the following address (because the Android emulator currently can’t use localhost for this type of thing):









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.



Visual Studio Hosting - ASPHostPortal :: Find Advantages of Using ComboBox in Visual Studio

clock September 9, 2011 07:55 by author Jervis

Today, I will show you the multipurpose of using ComboBox in visual Studio. Below examples will help you to know more about using find combo box.

1. Use Find Combo Box to Add New Project

Instead of  File > New Project, if you  type “>AddProj” and press “Enter”, it will launch “Add New Project” window.



2. Use Find Combo Box to Close All Open Documents

Use Find combo box to close all the open files at a time by just typing “>CloseAll”.






3. Use Find Combo Box to Open Task List

Just type “>TaskList” and Press enter to open to task list from combo box.



4. Use Find Combo box to add variables in watch windows

You can type >?? <VariableName> to add a variable in watch window from find combo box.





Similarly use can use all the predefined command aliases in visual studio.  You can check and try all of them from Predefined Visual Studio Command Aliases .  Apart from the available predefined aliases you can create your own aliases for visual studio by just following How to: Create Custom Aliases for Visual Studio Commands

You do not need to remember all these commands as they are all auto populated in find combo box. Just type “>”, you will able to see the list of all commands available



Hope this will help you to take some more advantages of Find Combo Box !

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.



About ASPHostPortal.com

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


Corporate Address (Location)

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

Sign in