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 4 Hosting - Mobile Views Setting in MVC 4

clock February 27, 2013 07:54 by author andy_yo

MVC 4 has a new way to deal with mobile views.  You can now set up individual display modes for mobile and desktop views.  First you need to register the new display mode in the app_start method of the global.asax file.

DisplayModeProvider.Instance.Modes.Insert(0

       , new DefaultDisplayMode("mobile")

       {    

          ContextCondition = (ctx => ctx.Request.Browser.IsMobileDevice)

       });

Here we added a display mode called “mobile” that we set the condition to use this new mode to mobile devices.  Now we would create a controller and view as usual.  Say we create a Home controller with an Index action.  Next we create a new view using the razor engine called Index.cshtml.  To use the newly created display mode we would just create a second view and call it index.mobile.cshtml.  By using this naming convention we are telling MVC to use the index.cshml view for all requests to the Home controller and Index action, but if the condition of the display mode is met, use the index.mobile.cshtml view.  One of the real nice things about this approach is that if a request meets the condition for a mobile view, but one doesn’t exist, it will default back to the desktop view.

You can also use this same convention with master pages.  For the _layout.cshtml, you would add a _layout.mobile.cshtml.  Be careful though, as a side effect of the view defaulting back to the desktop view if the mobile one doesn’t exist, you can get a mismatch of master page and view.  If this is not desirable, then can add the following line into your _ViewStart.cshtml file of your site:

DisplayModeProvider.Instance.RequireConsistentDisplayMode  = true;

This is a great way to set up you site with a mobile view and a desktop view and use the same controller for both.

 



ASP.NET MVC 4 Hosting - Razor 2.0 Features in ASP.NET MVC 4

clock February 19, 2013 12:26 by author andy_yo

First version of razor is shipped with ASP.NET MVC 3. ASP.NET MVC 4 come with Razor V2.0. Razor V2.0 includes some new features.

About ASPHostPortal.com
ASPHostPortal.com is Microsoft No #1 Recommended Windows and ASP.NET Spotlight Hosting Partner in United States. Microsoft presents this award to ASPHostPortal.com for ability to support the latest Microsoft and ASP.NET technology, such as: WebMatrix, WebDeploy, Visual Studio 2012, ASP.NET 4.5, ASP.NET MVC 4.0, Silverlight 5 and Visual Studio Lightswitch. Click here for more information

 

URL Resolution Enhancements:

We use the relative URL for any resources (images, scripts, css) in code , for example :

<script src=”~/Scripts/jquery-1.8.2.js”></script>

But in runtime we should resolve the full path of the resource (absolute URL), to do this in ASP.NET MVC 3 we use Content() method of UrlHelper class.

<script src=’@Url.Content(“~/Scripts/jquery-1.8.2.js”)’></script>

In Razor V2.0 no need to use @Url.Content() method, razor v2.0 now resolves (absolute path/URL) ~/ (tilde-slash) within all standard HTML attributes, razor v2.0 now allows you to just write  :

<script src=”~/Scripts/jquery-1.8.2.js”></script>

Conditional Attribute Enhancements:

Hers is a classic example for conditional attributes, I have a <div> tag with class attribute. The class name is a dynamic value, It will be resolved at runtime based on some condition in razor code. If the condition is satisfied  class attribute will have some value, else it will be null. When there is a value no issues, but when value is null  we should not apply it for class attribute, to be strict when there is no value for class attribute we should not render it. This scenario involves with writing some ugly code with if condition & <text> tag, in Razor1.0 (ASP.NET MVC 3) code snippet as follows.

 

In Razor 2.0 (ASP.NET MVC 4) now we can write:

 

 

Above code returns the same results as earlier, for example if the @ViewBag.UseRoundCorners value is true, then myClass value is roundCorners, then  razor will render :

<div class=”roundCorners ”></div>

If @ViewBag.UseRoundCorners value is false, then myClass value is null, then razor will render <div> tag with out class attribute:

<div></div>

Razor V2.0 can handle multiple values in conditional attributes:

For example class attribute has multiple values <div class=”@myClass heading”></div>, now razor will render <div class=”roundCorners  heading”></div> if @myClass is not null, if @myClass is null, then razor will simply render <div class=”heading”></div>.

Razor V2.0  can handle Boolean values in conditional attributes:

Not only null values & multiple values, razor can handle boolean values also in conditional attributes.

<input type=”checkbox”  checked=”@ViewBag.Checked” />

If @ViewBag.Checked value is true then razor will render:

<input type=”checkbox”  checked=”checked” />

If @ViewBag.Checked value is false then razor will render:

<input type=”checkbox”  />



DotNetNuke Hosting - DotNetNuke versus Joomla

clock February 5, 2013 05:45 by author andy_yo

DotNetNuke and Joomla are two very popular CMS (Content Management Systems) based on different technologies. DotNetNuke is a content management system written in Visual Basic and based on the Asp.Net framework, whereas Joomla is based on the popular PHP framework. Each has its own advantages and disadvantages which we will discuss further in detail.

About ASPHostPortal.com

ASPHostPortal.com is Microsoft No #1 Recommended Windows and ASP.NET Spotlight Hosting Partner in United States. Microsoft presents this award to ASPHostPortal.com for ability to support the latest Microsoft and ASP.NET technology, such as: WebMatrix, WebDeploy, Visual Studio 2012, ASP.NET 4.5, ASP.NET MVC 4.0, Silverlight 5 and Visual Studio Lightswitch. Click here for more information

Core Functionality: DNN offers extensive core functionalities in front of which Joomla seems a little weak. DNN offers features like database replication, event management, photo gallery and built-in forum system. Joomla also offers various functionalities that are not available in any other PHP based CMS, such as load balancing and a trash bin to ensure that articles are not accidentlly deleted. However, Joomla still falls short of DNN in context of their core functionalities.

Customization and Extensions: Joomla compensates the lack of core functionalities by allowing extensive third party plugins and customization facilities. Joomla provides a core framework around which developers can develop any site with desired functionalities. There is a plugin available for everything in Joomla therefore extra functionality can be added and customized according to client's requirements. Moreover, vast number of templates are available on the internet from which developers can chose the suitable themes and customize them according to their needs.

However, the template designs in Joomla are often based upon similar layouts which usually end up in the development of too many similar looking websites with slight changes in the design and color. DNN however offers a high level of flexibility thus provides an opportunity to create unique websites.

Basic Technology: Both Joomla and DotNetNuke are built upon different technologies which makes it essential to take their technical differences into account. Joomla uses technologies like PHP and MySQL backend which are extensively used for web development and web application development. On the other hand, DotNetNuke uses technically superior Asp.net framework from Microsoft which is too expensive for regular web-hosting environment. However, small and medium businesses usually have servers running on Microsoft's IIS which eliminates the open source advantage of Joomla.

DotNetNuke is more useful and feasible for corporate and enterprise intranets which require to integrate with the existing systems that are usually built using the same technology. They require sophistication, flexibility and robustness which are offered by DNN and can also be easily afforded by enterprises. Whereas, Joomla is designed to provide quick, expandable and cost effective web presence.

Support: The DotNetNuke offers extensive support depending upon the edition you have. The basic version provides developers forum through which users can get assistance from various other developers active on the forum. The paid "professional" version offers unlimited online support whereas the "Elite" edition provides live telephonic support with response under 2 hours. Joomla does not provide paid support system but there are various third party organizations offering training and support for Joomla.

The paid versions of DotNetNuke, i.e. "professional" and "elite" version are extensively tested and verified officially which makes them a good choice for business applications that require stability and perfectness.

Ease of Usage: DotNetNuke allows for quick and easy content editing functionality whereas in Joomla users have to first sign into a different section on the site before they can make changes to content. You can easily change the position of modules in DNN by drag and drop functionality which makes it so easier. Apart from this both the frameworks offer similar ease of use via features such as built in macro languages, ability to mass upload and search engine friendly URLs.

While comparing them we just cannot declare one better than the other as each has some advantages and disadvantages of its own. What we can say with certainty is that DotNetNuke is better for business applications and creation of business scale websites whereas Joomla is ideal for making quick, functional and cost effective web sites.

 

 



Cloud Hosting - Advantages of Cloud over traditional Shared Server

clock February 4, 2013 09:33 by author andy_yo

Everyone is interested in cloud hosting at this moment in time. Traditionally, websites have been hosted on standard dedicated servers. Dedicated servers host lots of websites. On each dedicated server, a shared hosting account is kept. A dedicated server for email or Mysql is sometimes employed. When it comes down to it though, all your eggs are in one basket. The obvious downside of this is that if the dedicated server develops a fault, your website will be down. Cloud server is different. Cloud panels have numbers on its side.

 

About ASPHostPortal.com

ASPHostPortal.com is Microsoft No #1 Recommended Windows and ASP.NET Spotlight Hosting Partner in United States. Microsoft presents this award to ASPHostPortal.com for ability to support the latest Microsoft and ASP.NET technology, such as: WebMatrix, WebDeploy, Visual Studio 2012, ASP.NET 4.5, ASP.NET MVC 4.0, Silverlight 5 and Visual Studio Lightswitch. Click here for more information

Cloud server is extremely scalable, as in you can choose to pay for what resources you use. It’s very like mobile phones that offer a pay as you go tariff. If you use a small amount of resources, you only pay for those resources. If you are suddenly hit with loads of traffic, the cloud will let you expand instantly. Cloud hosts automatically assign what power you need. Your website should never go offline because of an unexpected spike in traffic. You would simply be billed for the extra used. In this respect, cloud hosting is more cost effective. Remember you are still in a virtual hosting environment of your own- no sharing. No need for an expensive dedicated server anymore.

Cloud hosting is more reliable. Whether cloud hosts are more reliable is the subject of fierce debate. There are however, many arguments for. We looked at the scenario of standard shared hosting where if one single dedicated server fails, your website goes offline. Cloud hosting is made up of many many nodes or dedicated servers. Thus you can weather one or even two nodes going offline at the same time. Cloud hosting surely has to be considered more reliable.

Deploying cloud hosting is very quick and easy. Deploying the hardware is the first part of dedicated server hosting. Then you have to setup software and services. Cloud hosting knocks this issue on the head. You slot in servers as and when you need them. One thing to consider about cloud hosting, is it is a relatively new technology. There are a few down sides with cloud hosting, where a traditional dedicated server or shared hosting environment can offer bigger benefits. However, the reliability cost and scalability of cloud software wins hands down. Those hosts that don’t already have a cloud product, are developing one right now. This speaks volumes. Cloud hosting certainly has more benefits over traditional hosting. Watch clouds continue to improve as cloud software does.

 



WebDeploy Hosting - Advantages of using WebDeploy over FTP

clock February 1, 2013 15:01 by author andy_yo

What is Web Deploy?

Web Deploy is an extensible client-server tool for syncing content and configuration to IIS. Web Deploy is used primarily in two scenarios:

  1. Developers use it to sync (aka ‘publish’) a compiled web applications (ASP .Net, PHP etc) from developer tools (Visual Studio, WebMatrix, etc) to IIS
  2. IT professionals use it to migrate websites & applications from an operating system running an older version of IIS such as IIS6 to an operating system running a newer version of IIS such as IIS 7.5.

Comparison between WebDeploy and FTP

Web Deploy is often compared to technologies like FTP, XCOPY or RoboCopy. While these technologies are useful, Web Deploy offers several benefits.

About ASPHostPortal.com

ASPHostPortal.com is Microsoft No #1 Recommended Windows and ASP.NET Spotlight Hosting Partner in United States. Microsoft presents this award to ASPHostPortal.com for ability to support the latest Microsoft and ASP.NET technology, such as: WebMatrix, WebDeploy, Visual Studio 2012, ASP.NET 4.5, ASP.NET MVC 4.0, Silverlight 5 and Visual Studio Lightswitch. Click here for more information

Here is a comparison of Web Deploy to FTP:

  1. Web Deploy is faster than FTP. Web Deploy does not issue a different command for each operation. Instead, it does a comparison at the start of the sync and only transfers changes.
  2. Web Deploy is secure. Web Deploy supports transfer over HTTPS. Note that variants of FTP such as SFTP and FTPS are also secure.
  3. Web Deploy can set security descriptors (ACLs) on destination files and directories. For example, you can use Web Deploy to give a Windows user specific access to your application’s ‘Downloads’ folder during deployment.
  4. Web Deploy can publish databases. Web Deploy has out-of-box support for scripting out SQL Server, MySQL Server, Sqlite and SQL Server Compact databases and applying the resulting script during the sync. This can be very handy if your app needs a database to function.
  5. Web Deploy can apply transforms during deployment. You can use Web Deploy to change a connection string or application setting during a sync. Web Deploy supports a large range of transforms, including transforming IIS settings.
  6. Web Deploy integrates with Visual Studio 2010 and WebMatrix.
  7. Web Deploy is extensible. Web Deploy has a rich, publicly-accessible extensibility model which lets you author new scenarios.


WordPress Hosting – How To Resolve Download Failed for Installing WordPress Plugin or Updates in Windows Server 2012

clock February 1, 2013 12:43 by author andy_yo

After installing WordPress on our Windows Server 2012, we encountered a quite strange behavior. We can’t install new plugins or update our WordPress version, it always ends up with error: 'Download failed: Destination directory for file streaming does not exist or is not writable'. For example when we want to update the WodPress version:

Update WordPress

Downloading update from http://wordpress.org/wordpress-3.5.1-partial-0.zip…

Download failed.: Destination directory for file streaming does not exist or is not writable.

Installation Failed

Eventually, we started to do some research on this issue. In this article, we’ll try to give an overview of this issue, explaining why this occurs on Windows and how to solve this.

About ASPHostPortal.com

ASPHostPortal.com is Microsoft No #1 Recommended Windows and ASP.NET Spotlight Hosting Partner in United States. Microsoft presents this award to ASPHostPortal.com for ability to support the latest Microsoft and ASP.NET technology, such as: WebMatrix, WebDeploy, Visual Studio 2012, ASP.NET 4.5, ASP.NET MVC 4.0, Silverlight 5 and Visual Studio Lightswitch. Click here for more information

We found that the source of the error is WordPress need to access the system’s default temp folder (C:\Windows\temp) before installing a new plugin or update its version, and IIS user doesn’t have the write and read permission to that folder.

So what we need to do is:

1.       Create a temp folder in our site root directory and give IIS user the write and read permission to this folder.

2.       Change the default temp directory WordPress uses by adding this line to your wp-config.php:

         define('WP_TEMP_DIR','/path-to-the-folder-we-just-made');

Now we won’t those errors when we want to install plugin or update our WordPress because it already have the permission to access the temp directory.

 



Plesk Hosting - Parallels Plesk Panel 11 Adds Improved Performance and Security for Web Hosts

clock February 1, 2013 09:47 by author andy_yo

Parallels officially launched Parallels Plesk Panel 11, the latest version of its web hosting control panel software.

 

 

About ASPHostPortal.com

ASPHostPortal.com is Microsoft No #1 Recommended Windows and ASP.NET Spotlight Hosting Partner in United States. Microsoft presents this award to ASPHostPortal.com for ability to support the latest Microsoft and ASP.NET technology, such as: WebMatrix, WebDeploy, Visual Studio 2012, ASP.NET 4.5, ASP.NET MVC 4.0, Silverlight 5 and Visual Studio Lightswitch. Click here for more information

 

Web hosting software provider Parallels announced on Tuesday it officially launched Parallels Plesk Panel 11, the latest version of its web hosting control panel software, which adds many benefits for web hosts including improvements in website performance and security.

 

The move comes a couple months after the latest version of Parallels Automation became generally available, giving its web hosting partners a lot more options when it comes to offering services to small and medium-sized business customers.

The new version of Parallels Plesk Panel features over 80 improvements that were made based on customer feedback and Parallels’ vision for the hosting and cloud industries.

New features include the latest web technologies and faster performance in dedicated and virtualized environments, the addition of enhanced web presence tools, and free priority support for those web hosts who select the premium Plesk Unlimited dedicated license.

Parallels Plesk Panel 11 includes enhancements in key feature areas to help web hosting providers and web designers to simplify their business operations, lower their costs and drive more revenue.

These features include better server performance with NGINX so that Linux users can now reduce their CPU and memory usage by up to 50 percent, through the use of the NGINX server in Parallels Plesk Panel 11.

The NGINX server is installed and configured automatically in Parallels Plesk Panel 11, which accelerates website access and application response times beyond what is available in default Apache Web servers.

Parallels Plesk Panel 11 also includes a new Parallels Web Presence Builder that offers a more intuitive website building tool for small businesses and novice users, enabling web hosts to differentiate itself in a competitive market with self-service design tools for their SMB customers.

Parallels Web Presence Builder includes drag-and-drop modules that let users customize their website content, and automatically update their Facebook pages to mirror the content and aesthetic of their website.

For web designers, Parallels Web Presence Builder can also be sold as an entry-level website building tool, which can later be leveraged to upsell customers to more advanced, custom site designs.

There are also many new free support options that focus on the specific needs of hosting providers and web designers who rely on Parallels Plesk Panel to run their online businesses.

“There is a set of add-on functionality that is going to be shipped with Plesk,” Adam Bogobowicz, senior director of product marketing at Parallels, said in a phone interview. “One of the collections of functions is Powerpack, and it gives you the ability to build mobile websites, provides you with improved security for your server, gives you a set of developer tools. The other is improved performance of the website — both the traditional website and the mobile website. Plesk Panel 11 is going to be the most secure version of Plesk Panel ever released. It’s definitely going to make harden and make the operations of the panel more secure for all web hosts.”

Customers with business-critical needs who purchase an Unlimited dedicated Plesk SKU license will now receive free support by email, while those customers who purchase Unlimited dedicated Plesk SKU with Parallels Plesk Power Pack will receive free premium support.

Parallels has partnered with Unity Mobile to improve the overall performance for mobile websites. Parallels Plesk Panel users can now take existing websites and render them for optimized viewing and browsing from any mobile device.

Parallels Pleask Panel 11 offers improved security over previous versions, including enhanced server security and password storage and encryption to avoid potential vulnerabilities. Additionally, security updates are now highly visible and easier to apply in Parallels Plesk Panel 11.

Many of the new features and enhancements in Parallels Plesk Panel 11 focus on innovation and support for the newest Web technologies, including support the latest operating systems such as openSUSE 12.1, Ubuntu 12.04, and Debian 6, full support for IPv6, both the Linux and Windows Server platforms, and Microsoft’s WebMatrix Web development tool.

The Parallels Plesk Panel 11 user interface is now customizable, and can be simplified or extended based on the needs and the technical responsibilities of the user.

Hosted application support is included through the use of the APS v1.2, allowing APS packaged applications to be easily deployed on Parallels Plesk Panel servers.

A new Software Development Kit is provided to create Parallels Plesk Panel extensions in both Linux and Windows Server, allowing ISVs and Web developers to customize and extend the functionality of Parallels Plesk Panel 11.

Parallels has partnered with over 60 web hosting providers to offer Parallels Plesk Panel 11 including 123-Reg, Cirrus Hosing, Go Daddy, Host Gator, HostDime, LeaseWeb, Media Temple, PacHosting, SoftLayer, Superb Internet, and Webfusion.

In March, Parallels product manager Blake Tyra recently gave a demo of the Parallels Plesk Panel, where he showcased some of its functions for hosting providers, server administrators and small business operators.

 

 



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