Windows 2012 Hosting - MVC 6 and SQL 2014 BLOG

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

ASPHostPortal Announces SQL Server 2012 Support

clock May 1, 2012 08:44 by author Jervis

ASPHostPortal is a premiere web hosting company that specialized in Windows and ASP.NET-based hosting, announces the deployment of SQL Server 2012 in its web hosting packages. The SQL Server 2012 is brand new database management software from Microsoft that provides robust solutions for businesses to organize and secure company's data in one large-scale framework.

One of the most powerful and recognized SQL database engines available, Microsoft SQL Server provides many different levels of functionality and feature sets, and the latest release includes greater uptime, enhanced query performance, and improved security features. Also included is the new ‘Business Intelligence’ version of the product, and a more scaled-down ‘Express’ version, featuring the new ‘LocalDB’ functionality.


"I am very proud today, as we again have been able to exceed expectations by being able to offer this latest version of SQL Server to our customers so quickly after its official release," said Robert Kruger, CEO of ASPHostPortal.com. "We continue to offer significant added value to Microsoft products. We prove our existence in this business."


ASPHostPortal offers hosting packages bundle with the SQL Server 2012, including ASP.NET hosting and also our Reseller Hosting. This is to ensure that its customers can always have the latest technology included in their account. Businesses with all of important data from each department need a framework to manage and secure all of that data. And it can be achieved by implementing the SQL Server 2012. This robust data warehouse development merges everything together and makes sure there is no leakage. SQL Server 2012 keeps every data on its place and works as its best.
 

For more information about this new product, please visit our site at
http://asphostportal.com/Cheap-SQL-2012-Hosting.aspx.

About ASPHostPortal:

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".



Silverlight 5 Hosting - ASPHostPortal :: PivotViewer Custom DetailPaneStyle in Silverlight 5

clock April 24, 2012 07:08 by author Jervis

One of the added API features of the new Silverlight 5 PivotViewer is the ability to define a custom detail pane. It is rather simple to replace the style with your own, however, then you are left with the task of implementing several features that you most likely want to keep (like when to show and hide your detail pane). There are also a few other states and navigation features that would also be nice to keep. We will look at how you can replace the default implementation with the smallest amount of code and keep the functionality that you will want to keep.

In order to keep from reinventing the wheel when implementing our new detail pane, we are going to start off with the
PivotViewerDetailPane control. This is the control that is being used in the default implementation. By using our own instance of the control, we are able to take advantage of all of that hard work the PivotViewer team has done for us.

The first thing we need to do is see how to implement our own copy of the control. You can override the default implementation by setting the DetailPaneStyle property on the PivotViewer. Here is what an example would look like :


<pivot:PivotViewer x:Name="pViewer">
    <pivot:PivotViewer.DetailPaneStyle>
        <Style TargetType="pivot:PivotViewerDetailPane">
        </Style>
    </pivot:PivotViewer.DetailPaneStyle>
</pivot:PivotViewer>


This simply sets the
DetailPaneStyle to a basic implementation of the PivotViewerDetailPane. However, if we run our example, we soon see that it is close, but not quite the default we are looking for. Now the good news is that we have proved to we have overridden the default.



With a bit more research, you will see that you need to set some default colors. Here are the colors that are originally set:


<
pivot:PivotViewer.DetailPaneStyle>
    <Style TargetType="pivot:PivotViewerDetailPane">
        <Setter Property="Foreground"
                Value="{Binding Foreground,
                RelativeSource={RelativeSource Mode=FindAncestor,
                AncestorType=pivot:PivotViewer}}"
/>
        <Setter Property="Background"
                Value="{Binding Background,
                RelativeSource={RelativeSource Mode=FindAncestor,
                AncestorType=pivot:PivotViewer}}"
/>
        <Setter Property="BorderBrush"
                Value="{Binding BorderBrush,
                RelativeSource={RelativeSource Mode=FindAncestor,
                AncestorType=pivot:PivotViewer}}"
/>
        <Setter Property="AccentColor"
                Value="{Binding AccentColor,
                RelativeSource={RelativeSource Mode=FindAncestor,
                AncestorType=pivot:PivotViewer}}"
/>
        <Setter Property="Background"
                Value="{Binding SecondaryBackground,
                RelativeSource={RelativeSource Mode=FindAncestor,
                AncestorType=pivot:PivotViewer}}"
/>
        <Setter Property="ControlBackground"
                Value="{Binding ControlBackground,
                RelativeSource={RelativeSource Mode=FindAncestor,
                AncestorType=pivot:PivotViewer}}"
/>
        <Setter Property="SecondaryForeground"
                Value="{Binding SecondaryForeground,
                RelativeSource={RelativeSource Mode=FindAncestor,
                AncestorType=pivot:PivotViewer}}"
/>
        <Setter Property="PrimaryItemValueBackgroundColor"
                Value="{Binding PrimaryItemValueBackgroundColor,
                RelativeSource={RelativeSource Mode=FindAncestor,
                AncestorType=pivot:PivotViewer}}"
/>
        <Setter Property="SecondaryItemValueBackgroundColor"
                Value="{Binding SecondaryItemValueBackgroundColor,
                RelativeSource={RelativeSource Mode=FindAncestor,
                AncestorType=pivot:PivotViewer}}"
/>
    </Style>
</pivot:PivotViewer.DetailPaneStyle>


As you can see, the detail pane is using the new Silverlight 5 Feature RelativeSource binding to carry the theme colors of the PivotViewer to the detail pane. Obviously, this gives you an opportunity to create your own custom colors if you so choose. If not, it gets us back to the starting point.




Now that we are at a good starting point, let’s figure out what we want to modify. Most of the people I have talked to are only interested in modifying the contents of the detail pane itself and not the entire shell. So we will focus this discussion on the modifying the
ContentTemlate of the PivotViewerDetailPane.



When you replace the
ContentTemplate there are a couple of things you need to remember. The first is the default width of the original template is 190px. The detail pane will grow to accommodate any size that you need, but that is what the default is. The other thing to remember is a bit tricky, and that is the visibility of the contents. If you do not collapse your container by default, then it will be visible while the PivotViewer is loading. It causes a weird user experience and should be handled. We can handle that with a multi-part binding. First we bind the Visibility to the IsShowing property of the PivotViewerDetailPane. We have to write a value converter to change the bool IsShowing to a Visibility. If you haven’t had to do that before, it’s a handy little converter to keep in your toolkit.

public class BoolToVisibilityConverter : IValueConverter
{

    public object Convert(object value,
        Type targetType,
        object parameter,
        System.Globalization.CultureInfo culture)
    {
        if(value is bool)
        {
            return (bool) value ?
                    Visibility.Visible :
                    Visibility.Collapsed;
        }

        return Visibility.Collapsed;
    }

    public object ConvertBack(object value,
        Type targetType,
        object parameter,
        System.Globalization.CultureInfo culture)
    {
        throw new NotImplementedException();
    }
}


Now you are able to set up your custom detail pane. Here is very simple example using a dummy data set that has a
Color property in it. We are replacing the default content with an Ellipse that is filled with the Color property of our object.

<Setter Property="ContentTemplate">
    <Setter.Value>
        <DataTemplate>
            <Grid Width="190"
                Visibility="{Binding IsShowing,
                RelativeSource={RelativeSource
                AncestorType=pivot:PivotViewerDetailPane},
                Converter={StaticResource boolConv},
                FallbackValue=Collapsed}">
                <Ellipse Width="100" Height="100"
                         Fill="{Binding Color}"
                         VerticalAlignment="Top"
                         Margin="0,30,0,0"/>
            </Grid>
        </DataTemplate>
    </Setter.Value>

</Setter>




Obviously this is a rather simplistic detail pane, so feel free to make yours a bit more complex and interesting.


Get Silverlight 5 Hosting with only $2.00/month at ASPHostPortal.com.



ASP.NET MVC 3 Hosting - ASPHostPortal :: User Activity logging in ASP.NET MVC app using Action Filter and log4net

clock April 6, 2012 07:59 by author Jervis

In this post, I will demonstrate how to use an action filter to log user tracking information in an ASP.NET MVC app. The below action filter will take logged user name, controller name, action name, timestamp information and the value of route data id. These user tracking information will be logged using log4net logging framework.

public class UserTrackerAttribute : ActionFilterAttribute, IActionFilter

{         


    public override void OnActionExecuted(ActionExecutedContext filterContext)
    {
        var actionDescriptor= filterContext.ActionDescriptor;
        string controllerName = actionDescriptor.ControllerDescriptor.ControllerName;
        string actionName = actionDescriptor.ActionName;
        string userName = filterContext.HttpContext.User.Identity.Name.ToString();
        DateTime timeStamp = filterContext.HttpContext.Timestamp;
        string routeId=string.Empty;
        if (filterContext.RouteData.Values["id"] != null)
        {
            routeId = filterContext.RouteData.Values["id"].ToString();
        }
        StringBuilder message = new StringBuilder();
        message.Append("UserName=");
        message.Append(userName + "|");
        message.Append("Controller=");
        message.Append(controllerName+"|");
        message.Append("Action=");
        message.Append(actionName + "|");
        message.Append("TimeStamp=");
        message.Append(timeStamp.ToString() + "|");
        if (!string.IsNullOrEmpty(routeId))
        {
            message.Append("RouteId=");
            message.Append(routeId);
        }
        var log=ServiceLocator.Current.GetInstance<ILoggingService>();
        log.Log(message.ToString());
        base.OnActionExecuted(filterContext);
    }
}

The LoggingService class is given below


public class LoggingService : ILoggingService

    {
        private static readonly ILog log = LogManager.GetLogger
            (MethodBase.GetCurrentMethod().DeclaringType);
        public void Log(string message)
        {
            log.Info(message);
        }
    }
    public interface ILoggingService
    {
        void Log(string message);
    }

The LoggingService class is using log4net framework for logging. You can add reference to log4net using
NuGet.

The following command on NuGet console will install log4net into your ASP.NET MVC app.

PM> install-package Log4Net

The below configuration information in web.config will configure log4net for using with Sql Server

Let me add a log4net section to the <configSections> of web.config

<section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler,Log4net"/>

The below is the log4net section in the web.config file

<log4net>
    <root>
      <level value="ALL"/>
      <appender-ref ref="ADONetAppender"/>
    </root>
    <appender name="ADONetAppender" type="log4net.Appender.AdoNetAppender">
      <connectionType value="System.Data.SqlClient.SqlConnection, System.Data, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
      <connectionString value="data source=.\SQLEXPRESS;Database=MyFinance;Trusted_Connection=true;" />
      <commandText value="INSERT INTO Log ([Date],[Thread],[Level],[Logger],[Message]) VALUES (@log_date, @thread, @log_level, @logger, @message)" />
      <parameter>
        <parameterName value="@log_date" />
        <dbType value="DateTime" />
        <layout type="log4net.Layout.PatternLayout" value="%date{yyyy'-'MM'-'dd HH':'mm':'ss'.'fff}" />
      </parameter>
      <parameter>
        <parameterName value="@thread" />
        <dbType value="String" />
        <size value="255" />
        <layout type="log4net.Layout.PatternLayout" value="%thread" />
      </parameter>
      <parameter>
        <parameterName value="@log_level" />
        <dbType value="String" />
        <size value="50" />
        <layout type="log4net.Layout.PatternLayout" value="%level" />
      </parameter>
      <parameter>
        <parameterName value="@logger" />
        <dbType value="String" />
        <size value="255" />
        <layout type="log4net.Layout.PatternLayout" value="%logger" />
      </parameter>
      <parameter>
        <parameterName value="@message" />
        <dbType value="String" />
        <size value="4000" />
        <layout type="log4net.Layout.PatternLayout" value="%message" />
      </parameter>
    </appender>
  </log4net>


Configure log4net

The below code in the Application_Start() of Global.asax.cs will configure the log4net

log4net.Config.XmlConfigurator.Configure();


The below Sql script is used for creating table in Sql Server for logging information

CREATE TABLE [dbo].[Log] (
[ID] [int] IDENTITY (1, 1) NOT NULL ,
[Date] [datetime] NOT NULL ,
[Thread] [varchar] (255) NOT NULL ,
[Level] [varchar] (20) NOT NULL ,
[Logger] [varchar] (255) NOT NULL ,
[Message] [varchar] (4000) NOT NULL
) ON [PRIMARY]

 



ASP.NET MVC 3 Hosting - ASPHostPortal :: ASP.NET MVC 3 Routing

clock March 15, 2012 07:52 by author Jervis

Routing in an ASP.NET module is responsible for mapping incoming browser requests to a particular MVC controller action.

When Requests arrive to an ASP.NET MVC-based web application it actually first passes through the UrlRoutingModule object, which is an HTTP module.


This module parses the request; i.e. the request from the URL and performs route selection. The UrlRoutingModule object selects the first route object that matches the current request.


If no routes match, the UrlRoutingModule object does nothing and lets the request fall back to the regular ASP.NET or IIS request processing.


Now From the selected Route object, the UrlRoutingModule object contains the IRouteHandler object that is associated with the Route object. This is an instance of MvcRouteHandler. The IRouteHandler instance creates an IHttpHandler object that passes it the IHttpContext object. By default, the IHttpHandler instance for MVC is the MvcHandler object. The MvcHandler object then selects the controller that will ultimately handle the request.


See when an ASP.NET MVC web application runs in IIS 7.0, no file name extension is required for MVC projects. So you cannot find the .aspx,.ascx,.asmx extension.


Now when you create a new ASP.NET MVC application, it will automatically configure to use ASP.NET Routing. ASP.NET Routing is set up in two places:


1. Webconfig File

2. Global.asax file

Now interestingly when you create a MVC2 application a route table is automatically created in the application's Global.asax file.


As we all know the Global.asax contains event handlers for ASP.NET application lifecycle events. The route table is created during the Application Start event. So when you open the Global.asax file you will see the following code:


using System;

using System.Collections.Generic;

using System.Linq;

using System.Web;

using System.Web.Mvc;

using System.Web.Routing;

namespace MvcApplication1

{

// Note: For instructions on enabling IIS6 or IIS7 classic mode,

// visit http://go.microsoft.com/?LinkId=9394801

public class MvcApplication : System.Web.HttpApplication

{

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 = "" } // Parameter defaults

);

}

protected void Application_Start()

{

RegisterRoutes(RouteTable.Routes);

}

}

}


See here the routing is occuring in the "RegisterRoutes" method.


See in the routes.MapRoute method we are passing 3 parameters.


1. Controller(Name of the controller)

2. Action (The method inside the controller)
3. id (Parameter)

See in the above url before home it is domain. The home is control. The action method is the index with parameter id. Now in the home controller the code will be:


using System.Web.Mvc;

namespace MvcApplication1.Controllers

{

public class HomeController : Controller

{

public ActionResult Index(int id)

{

return View();

}

}

}


Conclusion:
So in this article we have seen what the functionality of routing in ASP.Net MVC 3 is.

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.



SSRS 2008 R2 Hosting - ASPHostPortal :: How to fix Reporting Services permissions are insufficient for performing operation (rsAccessDenied)

clock March 1, 2012 06:00 by author Jervis

If you are getting the following error while trying to access or deploy a SQL Services Reporting Services (ssrs) report server on your localhost:

The permissions granted to user 'domain\username' are insufficient for performing this operation. (rsAccessDenied)


Here's what to do:


1. Make sure you have access configured to the URL
http://localhost/reports using the SQL Reporting Services Configuration. To do this:

- Open Reporting Services Configuration Manager -> then connect to the report server instance -> then click on Report Manager URL.

- In the Report Manager URL page, click the Advanced button -> then in the Multiple Identities for Report Manager, click Add.
- In the Add a Report Manager HTTP URL popup box, select Host Header and type in: localhostClick OK to save your changes.

2. Now start/ run Internet Explorer using Run as Administator...

NOTE: If you don't see the 'Site Settings' link in the top left corner while at
http://localhost/reports it is probably because you aren't running IE as an Administator or you haven't assigned your computers 'domain\username' to the reporting services roles, see how to do this in the next few steps.

3. Then go to: http://localhost/reports (you may have to login with your Computer's username and password)


4. You should now be directed to the Home page of SQL Server Reporting Services here:
http://localhost/Reports/Pages/Folder.aspx

5. From the Home page, click the Properties tab, then click New Role Assignment

6. In the Group or user name textbox, add the 'domain\username' which was in the error message (in my case, I added: JERVIS-PC\JERVIS for the 'domain\username', in your case you can find the domain\username for your computer in the rsAccessDenied error message).

7. Now check all the checkboxes; Browser, Content Manager, My Reports, Publisher, Report Builder, and then click OK.

8. You're domain\username should now be assigned to the Roles that will give you access to deploy your reports to the Report Server. If you're using Visual Studio or SQL Server Business Intelligence Development Studio to deploy your reports to your local reports server, you should now be able to.

Try it and let me know if you have any problem. SSRS 2008 R2 hosting with only $2.00/month. CLICK HERE.

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.



WebMatrix Hosting - ASPHostPortal :: Common Error in WebMatrix

clock February 28, 2012 10:07 by author Jervis

Because Web Deploy is a client-server product, unless it is set up correctly, chances are you will hit a wall pretty quickly at the point where a connection is made. In this blog post, I will show you common solutions for common errors.

Read on for general tips and recipes for fixing common connectivity errors.


General Tips

-
Web Deploy sometimes returns different information in errors messages if you provide administrator credentials vs. non-administrator credentials. If you hit an error, try to run the command as administrator.
-  
Web Deploy sometimes returns different information if source and destination machine are the same vs. destination machine is remote. If you hit an error, try to run it on the remote machine.
-
Run the command with –verbose and –debug switches. These will make Web Deploy spit out more information which can be useful in debugging.

Error: 503 Server Unavailable

Error Trace:

msdeploy.exe -verb:dump -source:apphostconfig,computerName=demo-host

Error: Object of type ‘appHostConfig’ and path ” cannot be created.
Error: Remote agent (URL http://demo-host/MSDEPLOYAGENTSERVICE) could not be contacted. Make sure the remote agent service is installed and started on the target computer.
Error: An unsupported response was received. The response header ‘MSDeploy.Response’ was ” but ‘v1′ was expected.
Error: The remote server returned an error: (503) Server Unavailable.
Error count: 1.

Why it happens:


- Incorrect destination name or host unreachable.
- Remote Agent Service not installed on destination.

How to fix it:


- Make sure you can ping the remote computer.

- Run this command on the destination in an elevated command prompt: “net start msdepsvc”. This will start the Remote Agent Service on the destination, which allows administrator deployments.

Error: Default credentials cannot be supplied for the basic authentication scheme


Error Trace:

msdeploy.exe -verb:dump -source:apphostconfig,wmsvc=demo-host
Error: Object of type ‘appHostConfig’ and path ” cannot be created.
Error: The specified credentials cannot be used with the authentication scheme ‘basic’.
Error: Default credentials cannot be supplied for the basic authentication scheme.
Parameter name: authType
Error count: 1.


Why it happens:

-
You are telling Web Deploy to connect to the Web Management Service on the destination. By default, Web Deploy will connect using HTTP Basic Authentication.
-
When using HTTP Basic Authentication, specific credentials must be supplied, which is not true in the command shown above.

How to fix it:

Change the command to:

msdeploy.exe -verb:dump -source:apphostconfig,wmsvc=demo-host,authType:basic,username=someuser,password=somepassword

Error: The remote certificate is invalid according to the validation procedure.

Error Trace:


msdeploy.exe -verb:dump -source:apphostconfig,wmsvc=demo-host,authType=basic,username=someuser,password=somepassword
Error: Object of type ‘appHostConfig’ and path ” cannot be created.
Error: Could not complete the request to remote agent URL ‘https://demo-host:8172/msdeploy.axd?Site=’.
Error: The underlying connection was closed: Could not establish trust relationship for the SSL/TLS secure channel.
Error: The remote certificate is invalid according to the validation procedure.
Error count: 1.

Why it happens:


- You are connecting to the destination using the Web Management Service (wmsvc), which creates an HTTPS connection.
- The certificate on the destination is invalid, so you see this error.

How to fix it:

-
Install a valid wmsvc certificate on the destination
-
OR add the –allowUntrusted flag on the command

msdeploy.exe -verb:dump -source:apphostconfig,wmsvc=demo-host,authType=basic,username=someuser,password=somepassword –allowUntrusted

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.



WebMatrix Hosting - ASPHostPortal :: Passing value within 2 WebPages using Razor syntax

clock February 16, 2012 07:58 by author Jervis

Following will be the example if you would like to use Request QueryString to pass value between 2 CSHTML page.

We have have 2 web pages, Page.cshtml and Page2.cshtml. Under Page.cshtm, there will be a textbox and a button, whatever user enter in the textbox, it will be pass over to Page2.cshtml.

Here the code on Page.cshtml. We use the Request.Form to capture the input by the user from the textbox. The value then store in the variable "formValue" which will be pass over to Name under Response.Redirect.

@{ 
    var formValue = Request.Form["myTextBox"];  
    if (IsPost) 
     { 
         
        Response.Redirect("Page2.cshtml?name=" + formValue); 
         
     } 

<!DOCTYPE html> 
 
<html lang="en"> 
    <head> 
        <meta charset="utf-8" /> 
        <title>Page 1</title> 
    </head> 
    <body> 
 <form action="" method="post"> 
        <input type="text" id="myTextBox" name="myTextBox"/> 
                    <input type="submit" value="submit"/> 
</form>          
    </body> 
</html>


Here's the code on Page2.cshtml, please take note on the previous code Response.Redirect("Page2.cshtml?name=" + formValue); we actually pass the value to the variable named "NAME". so in Page2.cshtml, we will capture the value NAME. We used Request.QueryString to capture the value from the URL which will be
http://localhost/page2.cshtml?name=WHATEVERUSERINPUT.

@{ 
    var queryValue = Request.QueryString["name"];   


<!DOCTYPE html>  

<html lang="en"> 
    <head> 
        <meta charset="utf-8" /> 
        <title>Page 2</title> 
    </head> 
    <body> 
        @queryValue 
    </body> 
</html>

For this example, queryValue will return the value of "WHATEVERUSERINPUT".

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



ASP.NET MVC 3 Hosting - ASPHostPortal :: Use re-mix Library to Add Controller Actions with Mixins

clock February 13, 2012 06:05 by author Jervis

When developing ASP.NET MVC3 application one often needs to add similar actions to different controllers; for example controllers that enable the user to perform the basic CRUD (create, read, update, delete) operations typically contain action methods like Create(), Update() or Delete(). To avoid duplicate code a simple solution could be a common base controller. In complex applications this approach could have some limitations, since .NET does not support multi inheritance, e.g. each controller could have only one base controller.

This blog post shows a prototypically approach how to implement action methods that can be used in more than one controller with the help of the
re-mix library which adds mixins support to .NET. Since the approach shown below is only a proof of concept, it has some limitations that are listed at the end of the post.

After
downloading re-mix and adding references to the dll files contained in the folder net-3.5\bin\release one need a custom controller factory that uses remix’s ObjectFactory to create the controller objects:

public class RemixControllerFactory : IControllerFactory
{
  private IControllerFactory _defaultControllerFactory; 

  public RemixControllerFactory()
  {
    _defaultControllerFactory = new DefaultControllerFactory();
  } 

  public IController CreateController(RequestContext requestContext, string controllerName)
  {
    // Use the default ControllerFactory to get the type of the controller
    var controllerType = _defaultControllerFactory.CreateController(requestContext, controllerName).GetType(); 

    // Use remix's ObjectFactory to instantiate the (mixed) controller
    return (IController)ObjectFactory.Create(controllerType);
  } 

  public SessionStateBehavior GetControllerSessionBehavior(RequestContext requestContext, string controllerName)
  {
    return SessionStateBehavior.Default;
  } 

  public void ReleaseController(IController controller)
  {
  }
}

The custom RemixControllerFactory is set as the default controller factory in the Global.asax.as file:

protected void Application_Start()
{
  [...]
  ControllerBuilder.Current.SetControllerFactory(new RemixControllerFactory());
  [...]
}

In a next step we implement the interface that defines the action methods (Echo in this example) that will be used to extend the controllers:

public class IEchoControllerMixin
{
  ActionResult Echo(string id);
}


In a last step we implement the IEchoControllerMixin:

public class EchoControllerMixin : Mixin<ControllerBase>, IEchoControllerMixin
{
  public ActionResult Echo(string id)
  {
    var result = new ContentResult();
    var controllerName = Target.ControllerContext.RouteData.Values["controller"].ToString();
    result.Content = string.Format("re-mix added Echo action to controller '{0}'<hr/>You said: {1}", controllerName, !string.IsNullOrEmpty(id) ? id : "<i>nothing</i>");
    return result;
  } 

  [OverrideTarget]
  protected IActionInvoker CreateActionInvoker()
  {
    return new RemixControllerActionInvoker(typeof(IEchoControllerMixin));
  }
}

Due to security reasons ASP.NET MVC only allows to call action methods that are defined in a class that inherits System.Web.Mvc.ControllerBase. Since re-mix creates (automatically generated) proxy objects with their own inheritance structures, ASP.NET MVC does not find the Echo action by default. To bypass this limitation we implement a custom RemixControllerActionInvoker that allows calling actions that are defined in implementations of the IEchoControllerMixin interface. To do this we use reflection to call a non-public ASP.NET MVC functionality that creates an ActionDescriptor that skip the security check:

public class RemixControllerActionInvoker : ControllerActionInvoker
{
  private Type _remixType; 

  public RemixControllerActionInvoker(Type remixType)
  {
    _remixType = remixType;
  } 

  protected override ActionDescriptor FindAction(ControllerContext controllerContext, ControllerDescriptor controllerDescriptor, string actionName)
  {
    // Use default action descriptor
    ActionDescriptor actionDescriptor = controllerDescriptor.FindAction(controllerContext, actionName);
    if (actionDescriptor != null) return actionDescriptor; 

    // Create action descriptor that accepts actions that are defined in the remix type
    var internalConstructor = typeof(ReflectedActionDescriptor).GetConstructor(
      BindingFlags.NonPublic | BindingFlags.Instance, null, new [] { typeof(MethodInfo), typeof(string), typeof(ControllerDescriptor), typeof(bool) }, null
    );
    return (ActionDescriptor)internalConstructor.Invoke(new object[] { _remixType.GetMethod(actionName), actionName, controllerDescriptor, false });
  }
}

After all the preparations we are finally able to “intermix” the Echo action to any controller:

[Uses(typeof(EchoControllerMixin))]
public class Controller1Controller : Controller
{
}
[Uses(typeof(EchoControllerMixin))]
public class Controller2Controller : Controller
{
}

To test the Echo action in both controllers, just open http://localhost:[...]/Controller1/Echo/Hello or http://localhost:[...]/Controller2/Echo/Hello.

Summarized mixins enable adding actions to controllers without the need of a common base controller; actions defined in mixins are completely decoupled from any inheritance structure and can be added to any controller.

As written in introduction, the approach shown above is only prototypical and has some limitations (which should be resolvable with some additional logic/code):

1. Since the mixin overrides the CreateActionInvoker() of the controller that is “intermixed”, one could neither use more than one mixin in one controller nor use a custom CreateActionInvoker() method.

2. In actions defined in mixins one does not have access to the protected ASP.NET MVC controller methods that create ActionResult objects like View(), PartialView(), Json(), Content(), …

3. One needs to use reflection to call a protected ReflectedActionDescriptor constructor.

4. The RemixControllerActionInvoker implementation does not consider the action parameter when creating the action descriptor. In result the action names defined in the mixins needs to be unique.



Windows 2008 Hosting - ASPHostPortal :: Tips on Windows Command Prompt

clock January 13, 2012 07:34 by author Jervis

In this article we are going to see various commands and comments which I have gathered through my experience with Windows. Surely, you may know several commands on Windows, however many people may not know all of them.

The commands that we are going to see here are based on Windows XP the most commonly used today. Also, we are going to see how to make windows command prompt more friendly.

Basic Tips on Making Windows Command Prompt Friendly

When you open a session of it (Start >> Run >> cmd), by right-clicking the title bar, you can easily set default options for it. Selecting the “Properties” Menu will pop-up the title bar to set options which will be valid for all Windows prompt.

In the tab “Options” you may choose your cursor size, number of items in the command history and editing modes, including mode off “Insert” which by default eats the letters when you type on others.

In tab “Source”, it does not needfully define the source (it supports few, the”raster fonts”), simply the number of rows and columns of the window.

You can click the tab “Layout” and choose the default position of the window (ie. fixed distance from left and top of your screen) and the tab “Colors” to change the colors of black background.

Following are few shortcuts and commands that can be used:

1. Press [ALT] Left + [ENTER]: It is used to switch between full screen and window. Also applies to programs that open full screen in the simulation environment from MS-DOS, such as many games and control programs. In this case, usually the window will be minimized, showing the desktop, and the program paused. When the windows is minimized, the simulation program in MS-DOS is not being processed, for example, a game of any other program that is minimized will be paused until the window is active.

2. File names with spaces: Never forget to enter them in quotes. The spaces are the separators of parameters to pass file names without quotation marks to point to the computer means that the shares after the new space are parameters, and not a continuation of the file name you enter.

3. In order to copy text in command prompt, you need to right-click in the window and select “Mark”. Once you select the “Mark” option, drag the mouse normally, but do take care that it selects a block of characters and not in line as usually you do in a text editor. Being with selected text, simply right-click the window again or you may press ENTER button on your keyboard. The selection will get cleared the text will be copied. Now in order to paste the text, you need to right-click and select the “Paste” option.

4. It’s a very silly tip, but worth comment. If you wish to copy everything, you may right-click and choose “Select All” option. If you want to clear out the window, simply enter “cls” command to clear the past performance on the screen.

5. Without using a mouse the Options can also be accessed through the Control menu. Just press [ALT] Left + [SPACE] and use the arrow keys on your keyboard to access the options or copy text. It is very useful when running Windows in order insurance if you have a serial mouse, since it does not load the device in safe mode.

6. To view the information about a particular command, simply enter the command: help [commandname]. Remove the brackets before entering the commands. Another way to retrieve the info about a command is to enter the command: “commandname/?”. It applies to most of the programs but not all of them.

7. If a particular command is about to complete, you can force it to stop by typing [CTRL] + [C] in the command prompt. Be cautious while using this command, as it may compromise the system or user data.

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 :: Web Configuration Connection String setting in ASP.Net MVC 3 using Entity Framework

clock January 12, 2012 07:47 by author Jervis

In this article I will describe how to set the Web configuration file in ASP.Net MVC 3 using Entity Framework with object class mapping.

In your ASP.Net MVC 3 applications supposes you are using object class mapping using Entity Framework.

That means you write your classes using relationships and the classes will be converted to a table in the database. For that you have to set your Web .config file connection string setting. Because the connection string results in mapping a class to a table in the database and the data from the table will also come from the database.

Step 1:

First go to the Web config page for the main project like Figure 1:



Step 2:

Then comment the existing connection string code. (The existing code will not work for creating the tables from the mapping classes (POCO) classes).

After that paste the code shown below like figure 2:



So in this article we have learned how to change the connection string in the web.config file for ASP.Net MVC 3 using Entity Framework.

 

 



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

 photo ahp banner aspnet-01_zps87l92lcl.png

Author Link

Corporate Address (Location)

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

Sign in