Windows 2012 Hosting - MVC 6 and SQL 2014 BLOG

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

SSRS 2008 Hosting - ASPHostPortal :: Creating PDF File from ASP.NET Application from a in-memory dataset

clock July 27, 2011 07:31 by author Jervis

First, lets create an ASP.Net application using the new Project creation wizard.

Add a new project item and chose Report(report1.rdlc)



What we need now is a dataset, which we can use in reports. To do this, lets add a new item – dataset.



Lets name it as MyDataset.XSD. Lets open this dataset and add a table using the toolbox. Lets name it as DataTable1 and lets add two columns here Email and User. Lets compile this once so that we generate the dataset model.



Next step is to use this in our reports. Lets open the report designer(double click the RDLC added earlier) and add a DataSet to this. On report data panel, say New->Data Set.


Now select the Mydataset as the data source and the default table as dataset. Now we have Email and User as columns. Lets leave the name as DataSet1. Now its ready to be used in the report.

If everything goes right, you can add a tablix and associate the DataSet1 with it. Now you should see the fields available for using in reports.



I have mapped user and Email fields in the report.

Now lets focus back to our code. Open the markup and drop a report viewer control. This should look something like this.

    <rsweb:ReportViewer ID="repViewer" runat="server">
    </rsweb:ReportViewer>


Lets prepare the data to fill the report data using the C# code. We can do this in two ways.

1. Use the same dataset (MyDataSet)
2. Create the new dataset on the fly.

Lets try the second approach. On the code behind, lets create a data set and add a table to it and add some data

            DataSet ds = new DataSet();
            DataTable dt = new DataTable();

            dt.Columns.Add("User");
            dt.Columns.Add("Email");


            dt.Rows.Add("Guru", "[email protected]");
            dt.Rows.Add("Guru", "[email protected]");
            dt.Rows.Add("Guru", "[email protected]");
            dt.Rows.Add("Guru", "[email protected]");
            ds.Tables.Add(dt);


Now, lets bind this to the report

repViewer.Reset(); // follow the same order, reset and then add the data   repViewer.LocalReport.ReportPath = "Report1.rdlc";
           
reportDataSource rs = new ReportDataSource();
rs.Name = "DataSet1"; // Important: Use the same name as given in the report.
rs.Value = ds.Tables[0];
           
repViewer.LocalReport.DataSources.Add(rs);


Finally, rendering part. Lets return the response as a PDF file

string mimeType;
string encoding;
string extension;
Warning[] warnings;
string[] streamids;

byte[] reportBytes = repViewer.LocalReport.Render("PDF", null,
 out mimeType, out encoding,
 out extension, out streamids,
 out  warnings);

Response.ClearContent(); Response.ClearHeaders();
Response.AddHeader("Content-Disposition", "inline; filename=Test.pdf");
/ Response.AddHeader("Accept-Header", reportBytes.Length.ToString());
Response.ContentType = "application/pdf";
Response.OutputStream.Write(reportBytes, 0, reportBytes.Length);
Response.Flush();
Response.Close();


Only advantage of creating the dataset using XSD(MyDataSet) is that you can use them in the report directly by selecting the element. This will help you a lot while binding. You can also connect to SQL and build your data set and use it for report design. Later you can build your own dataset like we have done and use it by providing the same name.Following SQL statement will do the job for you.

Select 'Guru' as User, select 'Test' as Email

Screen shot below is the output, Pdf displayed in browser embedded. This approach will be a great help if you have specify requirement for printing involving the layout, breaks and header/footer.



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 2010 Hosting - ASPHostPortal :: Visual Studio 2010 Data-Centric WPF Applications

clock July 25, 2011 07:23 by author Jervis

Data Sources from Visual Studio 2010 allows for easily creating user interfaces for WPF applications to read/write data. Previously, with Visual Studio 2008 this was only available for Windows Forms applications, and used the DataSet behind the scenes. Now WPF is supported as well, and an Entity Framework can be used.

After creating a WPF application, a data source can be created. The data source that can be selected from the Data Source Configuration Wizard allows accessing  Database, a Service, an Object, and SharePoint.



After selecting the data source either the old DataSet can be used for accessing data, or a Entity Data Model can be created.



The Data Sources window now allows if data should be displayed within a DataGrid, as list or detail information. Then it’s possible to define the UI elements for each property of the DataSource, e.g. Label, TextBox, ComboBox, TextBlock… For a DateTime data type per default the DatePicker is selected. It’s also possible to add custom controls.



By drag&drop from the Data Sources window to the WPF designer the UI elements are added to the XAML code. The UI elements that are added are data-bound to CollectionViewSource elements. CollectionViewSource is a proxy to CollectionView that itself allows grouping, sorting, filtering, and navigation.

    <Window.Resources>
        <CollectionViewSource x:Key="racersViewSource"
            d:DesignSource="{d:DesignInstance my:Racer, CreateList=True}" />
        <CollectionViewSource x:Key="racersRaceResultsViewSource"
            Source="{Binding Path=RaceResults, Source={StaticResource racersViewSource}}" />
    </Window.Resources>

In the code-behind generated code a query is created across the object context to retrieve data from the database.

        private ObjectQuery<Racer> GetRacersQuery(Formula1Entities formula1Entities)
        {
            // Auto generated code

            ObjectQuery<Racer> racersQuery = formula1Entities.Racers;
            // Update the query to include RaceResults data in Racers. You can modify this code as needed.
            racersQuery = racersQuery.Include("RaceResults");
            // Returns an ObjectQuery.
            return racersQuery;
        }

This query is used when loading the Window to assign the Source property of the CollectionViewSource.

        private void Window_Loaded(object sender, RoutedEventArgs e)
        {

            Formula1Entities formula1Entities = new Formula1Entities();
            // Load data into Racers. You can modify this code as needed.
            CollectionViewSource racersViewSource = ((CollectionViewSource)(this.FindResource("racersViewSource")));
            ObjectQuery<Racer> racersQuery = this.GetRacersQuery(formula1Entities);
            racersViewSource.Source = racersQuery.Execute(MergeOption.AppendOnly);
        }


The generated code might not be the one exactly needed. For very simple scenarios it just might be enough and just needs small tweaks and additions to write data to the database.

In most scenarios the code needs bigger changes and additions. This technology still might be a good use for a start to create UI elements based on some data and change it afterwards. The generated XAML code for the UI can also be copied to different projects.

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.



Windows 2008 Hosting - ASPHostPortal :: How to Fix Error 502 “Active FTP not Allowed”

clock July 21, 2011 07:15 by author Jervis

Consider a scenario where you have a client workstation behind Forefront TMG 2010 and you are trying to download files from a FTP Server. You are successfully able to logon on the FTP but after type the command “dir” you get the error message below:



The message is pretty clear about what is going on, isn’t it? Well, it is but where do I enable this option? I don’t remember having this on ISA!! To address this issue you just need to enable a new option that we have on TMG, this option is located on the FTP Filter properties as shown below:



After enabling this option and apply the changes you should be able to list your files just fine. It is important to mention that this setting has nothing to do with the FTP Read Only option, that you had in ISA 2004/2006 and still have it on TMG. The FTP Filter when running in read only mode (see figure below) will blocks all commands in the control channel except the following ones:

“ABOR, ACCT, CDUP, CWD /0, FEAT, HELP, LANG, LIST, MODE, NLST, NOOP, PASS, PASV, PORT, PWD /0, QUIT, REIN, REST, RETR, SITE, STRU, SYST, TYPE, USER, XDUP, XCWD, XPWD, SMNT”



You can customize this list by using the sample script below (from
Configuring Add-ins MSDN article),in this example the script configures FTP Access Filter to allow only the USER and PASS commands:

Dim root
Dim ftpFilter
Dim vpSet
On Error Resume Next
Err.Clear
Set root = CreateObject("FPC.Root")
' Get the filter's administration object
Set ftpFilter = root.GetContainingArray.Extensions.ApplicationFilters("{680A928F-22B3-11d1-B026-0000F87750CB}")
If ftpFilter Is Nothing Then
    Wscript.Echo "FTP Access Filter ({680A928F-22B3-11D1-B026-0000F87750CB}) is not installed in array."
    WScript.Quit
End If
' Get the vendor parameter set containing the filter's configuration.
Set vpSet = ftpFilter.VendorParametersSets.Item("{680A928F-22B3-11D1-B026-0000F87750CB}")
'If this vendor parameters set does not exist, create it.
If vpSet Is Nothing Then
    WScript.Echo "Adding a vendor parameters set ({680A928F-22B3-11D1-B026-0000F87750CB})"
    Err.Clear
    Set vpSet = ftpFilter.VendorParametersSets.Add("{680A928F-22B3-11D1-B026-0000F87750CB}",False)
    ftpFilter.VendorParametersSets.Save
End If
' Add the required parameter.
vpSet.Value("AllowReadCommands") = "USER PASS"
vpSet.Save


Note: don’t change the default Read Only commands unless you have a real business need for that.

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.



Silverlight 4 WCF Hosting - ASPHostPortal :: How to Create A WCF RIA Service Using Entity Framework

clock July 19, 2011 06:42 by author Jervis

Here are directions to create a WCF RIA Service that uses a Entity Framework database. This demonstrates a web deployed application, and the method to set the connection string for the Entity Framework class in the web.config.













































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 :: ASP.NET MVC3 Razor Script Loading Tips

clock July 18, 2011 06:30 by author Jervis

Lately, I have been playing with few JavaScript frameworks and in today’s modern web applications it is very common that we are including tons of JavaScript files in our application. One of the thing that plays important role in application performance is how fast these script files are delivered into the browsers. I have extensively blogged on combining, compression and caching of JavaScript files in my old blog, in this post I will show you, how you can achieve parallelism in delivering the scripts in the browser with the Head JS library. If you do not know what parallel script downloading is and how does it impact on page speed, then I would suggest to read this article of the YSlow creator. In short, when a browser encounters a script tag in a page it halts its rending until it downloads the script file, the parallelism is actually archived by adding the script dynamically or by XHR depending upon the browser it is running.

Though there are several libraries like HeadJS which support parallelism in script downloading like
LABjs, ControlJS but I am bit partial to it due to jQuery like syntax. Other than script parallelism HeadJS also has few more features as like Modernizr but I will only show the script loading part in this post.

Now, in a typical ASP.NET MVC Application we usually load our shared scripts in the master page and specific scripts in content page, beside that we also want our content page script runs after the master page scripts. So we do have two tasks in hand first serialize the script files so that independent script files download first then dependent files and then serialize the script statements in document.ready.

So, the first thing we will do is add the HeadJS script loader in the head of the master layout file, like the following:

<head>
    <title>@ViewBag.Title</title>
    <script src="@Url.Script("head.load")"></script>
</head>


The Script is just an extension method of UrlHelper which just returns the regular or minified version of the script depending the debug compilation. But in your real application you should group, compress, cache and if possible create a different domain(e.g. static.yoursite.com or assets.yoursite.com) to host the scripts. Here is the code of the Script
method:

public static string Script(this UrlHelper instance, string scriptFileName)

{                  const string Path = "~/Scripts/";              
    return instance.Content(Path + scriptFileName +
(instance.RequestContext.HttpContext.IsDebuggingEnabled ? ".js" :
".min.js"));

}

Now, at the bottom of the master layout, I have added the following snippet:

<script>
        head.js("@Url.Script("jquery-1.4.4")", function() {
            head.js("@Url.Script("jquery-ui")")
                .js("@Url.Script("jquery.unobtrusive-ajax")")
                .js("@Url.Script("jquery.validate")",
"@Url.Script("jquery.validate.unobtrusive")")

                .js("@Url.Script("jquery.customSharedPlugin")");
            @RenderSection("scriptFiles", false)
        });                      head.ready(function() {
            $('#main').customSharedPlugin();
            @RenderSection("scriptOnReady", false)
        });                  </script>
</body>              </html>

For the shake of simplicity I am mostly using the scripts which comes with the default ASP.NET MVC project, in your real application it may vary. Now, in the above example I am first loading the jQuery as my other scripts depends upon it and in the callback which fires when the script is loaded I am loading the other depend scripts and these are the script files that are loaded simultaneously without blocking each other. Now when I am done with layout file script loading, I am using the new Razor RenderSction to include the content page scripts. But as I am marking the section as optional by passing false in the second argument, it is perfectly okay if the content page does not has its own script files. But if the content page has scripts then it is included in the following way:


@section scriptFiles {
    head.js("@Url.Script("jquery.customPlugin1")");              }

Next, the head.ready, it is executed when all of the scripts are loaded and like the script loading we are first calling the layout page specific code then using the RenderSection(also making it as optional) so that the content page can inject its script. Now, in the Content page:

@section scriptOnReady {
    $('#main > h2').customPlugin1();              }

So when the page renders it will render the following:

<script>
  head.js("/Scripts/jquery-1.4.4.js", function() {
      head.js("/Scripts/jquery-ui.js")
               .js("/Scripts/jquery.unobtrusive-ajax.js")
               .js("/Scripts/jquery.validate.js", "/Scripts/jquery.validate.unobtrusive.js")
               .js("/Scripts/jquery.customSharedPlugin.js");
                      head.js("/Scripts/jquery.customPlugin1.js");
     });                              head.ready(function() {
      $('#main').customSharedPlugin();
      $('#main > h2').customPlugin1();                 });
</script>

Happy reading.

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 :: Introducing MVC Development with the Razor View Engine for Visual Studio Developers

clock July 12, 2011 05:23 by author Jervis

The Razor View Engine is a precise, useful, light language that enables you to create views for MVC projects in ASP.NET still while keeping a separation of concerns, ability to test, and pattern based development.  ASP.NET MVC developers looking for a more concise syntax now have another option that's built-in (of course, there are many 3rd party view engines out there) with the language being a familiar light version of C#. 

The Razor View engine is used to create WebMatrix sites or Visual Studio MVC applications.  When using ASP.NET MVC with either engine, you'll stick to a style of development called "convention over configuration", meaning that you'll use certain naming conventions to name files, models, views, controllers, and other key application elements rather than storing lots of metadata about these same elements in a configuration file.  When using MVC in Visual Studio 2010, it's is setup so that you'll be guided to use convention over configuration, which becomes evident when exploring an ASP.NET MVC project.

Getting Started

Before you start, go and download these two things (as of this post; things are subject to change - these could end up in VS at some point):

- ASP.NET
MVC 3
-
Razor Syntax Highlighter Extension (not mandatory, but a huge help)

You can also find the Razor Syntax Highlighter by choosing Extensions Manager from the Visual Studio Tools menu.  Once installed, MVC 3 project templates are available from Visual Studio.  The MVC 3 Web Application template allows you to use either the Web Forms View Engine or the Razor View Engine, while MVC 2 Applications contain only the WF View Engine.



When creating a new MVC 3 project a new dialog box appears asking which application type, view engine, and testing framework you'd like to use.  You can and should add a test project so you can test your code, then actually write some tests in it.   The image below demonstrates selecting the internet application project template using Razor as the view engine, as well as the test framework.  The internet application MVC template adds in ASP.NET membership & security features to the project by creating the necessary model, view and controller for logging on and registering as a site user.



Verify that the project is created with three folders, one each for Models, Views, and Controllers which is the same folder structure as a MVC 2 site.  The project also contains auxiliary folders and files needed for the application such as the Content & App_Data folders.   Since this is an MVC application using the Razor View Engine, you will see a different file extension - .cshtml.  The .cshtml files are Razor View Pages written using the Razor View Engine.  If you're not familiar with Razor syntax, I've blogged about it
here, and the online documentation has more information as well. 



The application template sets up some models, views and controllers to start with, and is now ready for new models, views, and controllers.  I've found the easiest way to work with MVC in VS is to start with the model, move to the controller, then create the view, so we'll look at models first.

Models

A model is a representation of an underlying data store.  Models can be almost anything from any data source; EF or Linq2Sql Models, or a simple class.  The code the builds the model below consists of two classes, a ProductModel class and a Product class.  The ProductModel class returns a List<t> of Product objects in a property aptly named Products that represents one or more products in the data store .  Product objects contain ProductNumber, Name and Price properties and represent an individual product in the data store.  The model code representing these product objects is below:


using System.Collections.Generic;
namespace AdventureWorks.Models
{
    public class ProductModel
    {
        public List<Product> Products { get; set; }
        public ProductModel()
        {
            Products = new List<Product>();
            this.Products.Add(new Product("AB-00-J1" ,"Super Fast Bike" ,1000M));
            this.Products.Add(new Product("EE-9-OL"  ,"Durable Helmet"  ,123.45M));
            this.Products.Add(new Product("MMM99-54" ,"Soft Bike Seat"  ,34.99M));
        }
    }
 
    public class Product
    {
        public Product(string productNumber, string name, decimal price)
        {
            Name = name;
            Price = price;       
            ProductNumber=productNumber;
        }
        public string ProductNumber { get; set; }
        public string Name { get; set; }
        public decimal Price { get; set; }
       
    }
}


Models are handed over to views by controllers so the views can render the data from the model.  The model will extend business logic (of course, this is a simple example, business logic will likely be spread out into other applications & tiers). Models also provide validation information to the view via metadata & code.  You can add the model to the \Models folder or you can reference an external data model library.  In this case, the model's been added to the \Models folder.

Controllers

Controllers are objects that inherit from the System.Web.Mvc.Controller class that match models with views.  During incoming requests, MVC's routing system kicks in and determines which controller method to use based on routing code set in the global.asax.cs file.  A default route is set in the global.asax.cs file that works for most of the routes you'll need, however, if need be then you can modify/add/delete your own routes.

Staying within convention, controller code files should go in the \Controllers folder. The controller class must follow the naming convention of YourNameController, i.e., ProductsController.  The controller's Index method, again following convention, must be named the same name as its view but without the file extension.  By following this pattern, the controller can have multiple actions that deliver data to multiple views, making code easier to write, maintain, and test.

namespace
AdventureWorks.Controllers
{
    public class ProductsController : Controller
    {
        public ActionResult Index()
        {
            ProductModel p = new ProductModel();           
            return View(p.Products);
        }
    }
}


By observing the previous code sample and the conventions that it follows, it's clear that the Index method maps to the \Views\Products\Index.cshtml view.  The Index() method's return type is an
ActionResult from the System.Web.Mvc namespace.  There's many different results that you can use for different scenarios such as ContentResult, FileResult, RedirectResult, ViewResult and others depending on your view's needs

Views

Views are a mechanism to format and render data in a browser from the model, as specified by the @model attribute (or @inherits) at the top of the view.  Views in ASP.NET MVC with either the ASPX or Razor View engines use a code-based way to render the page rather than relying on declarative controls, which create tight coupling and are hard to test.  Using the MVC approach creates cleaner output in the browser as well as cleaner and more terse syntax in the views as well.  Views are meant to only render the markup, code and data; they're not meant as a place to store business logic. The model and tiers accessed by the model, are the appropriate places to host business logic.  The view can have a small amount of UI validation logic,as a first line of defense for input sanitation, e.g., required, regex and range validators.

To add a view to your project, right click on the controller and select Add View. 



Visual Studio will need some information about the view, which is supplied in the Add View dialog box:

1. Specify whether you want a strongly-typed view or not.  Creating a strongly-typed view allows you to refer to the underlying data structures in the classic object.property syntax.
2. Specify the view data class.  The dropdown list displays classes in your project that are part of the data model.
3. Specify the view engine.  ASPX and Razor are the options.
4. Specify the view content.  Choices are list, details, edit. etc...  Choosing this option creates .cshtml or .aspx view pages that do page rendering for you.



Here's what choosing these options will produce in a Razor view page named \Views\Products\Index.cshtml:

@model
List<AdventureWorks.Models.Product>
@{
    View
.Title = "Index";
    Layout = "~/Views/Shared/_Layout.cshtml";

}

<h2>Index</h2
>
<
p>
@Html.ActionLink("Create New", "Create")
</p
>
<
table>
  <tr>
    <th>Edit/Details/Del</th>
    <th>Product Number</th>
    <th>Name</th>
    <th>Price</th>
  </tr>
 
@foreach (var item in Model) {
  <tr>
    <td>
      @Html.ActionLink("Edit", "Edit", new { /* id=item.PrimaryKey */ })
      @Html
.ActionLink("Details", "Details", new { /* id=item.PrimaryKey */
})
|
      @Html.ActionLink("Delete", "Delete", new { /* id=item.PrimaryKey */ })
    </td>
    <td>
      @item.ProductNumber
    </td>
    <td>
      @item.Name
    </td>
    <td>
      @String.Format("{0:F}", item.Price)
    </td>
</tr>
}
</table>


Since the view is strongly typed, the data structure can be accessed as it is - an object with properties.  The code above loops through the model and renders a <TR> for each entity that the model holds along with <TD> tags and the actual data in them (ProductNumber, name and Price).  The result is a simple list of the three products in model with accompanying action links.



The HTML source shows a clean, precise table rendered to the browser



Summary

Rendering a list of products is very easy using MVC and the Razor View Engine, as is
updating/manipulating the data (logically what you'd do next if following this example).   If you're digging deeper into learning MVC w/Razor the next topics you'll want to get into are jQuery and HTML validation helpers for client side validation, and decorating the model with data annotations (also for validation).  The MVC web site has a ton of great examples and tutorials.

Although many ASP.NET MVC samples use the ASPX/Web Forms view engine they're easily compared & converted to razor pages - so don't avoid them, it's still a great way to learn both MVC w/Razor and the ASPX engine.

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 Fix Error - Cannot open database requested by the login. The login failed. Login failed for user ‘NT AUTHORITY\NETWORK SERVICE’

clock July 9, 2011 04:41 by author Jervis

This error is quite common and I have received it few times while I was working on a recent consultation project.

Cannot open database requested by the login. The login failed.
Login failed for user ‘NT AUTHORITY\NETWORK SERVICE’.


This error occurs when you have configured your application with IIS, and IIS goes to SQL Server and tries to login with credentials that do not have proper permissions. This error can also occur when replication or mirroring is set up.

If you search online, there are many different solutions provided to solve this error, and many of these solutions work fine. However, I will be going over a solution that works always and is very simple.

Fix/Workaround/Solution:

Go to SQL Server >> Security >> Logins and right click on NT AUTHORITY\NETWORK SERVICE and select Properties



In newly opened screen of Login Properties, go to the “User Mapping” tab. Then, on the “User Mapping” tab, select the desired database – especially the database for which this error message is displayed. On the lower screen, check the role db_owner. Click OK.




In almost all such cases, this should fix your problem.

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 :: Model binding XML in ASP.NET MVC 3

clock July 8, 2011 07:01 by author Jervis

ASP.NET MVC 3 introduced the concepts of service location to conditionally build providers and factories for various extension points, such as Value Providers, Model Metadata Providers, and notably, Model Binders. Model binders in ASP.NET MVC are responsible for binding contextual HTTP request data (and any other context information) into the action method parameters.

Most of the time, these values are served up through the DefaultModelBinder class, which in turn leans on a collection of Value Providers to, well, provide values to the Model Binder. Value providers are great for centrally modeling dictionary-centric information, such as HTTP request variables (form POST, query string, cookie values etc.)

Model binders operate at one level of abstraction up from value providers, where we take control of the entire object deserialization/resolution/composition step ourselves. XML is one area where we can easily provide deserialization seamlessly from our controller action knowing about it. Let’s look at a simple example of a controller action accepting XML and responding with XML:

public class MathController : Controller
{
    public ActionResult Square(Payload payload)
    {
        var result = new Result
        {
            Value = payload.Value * payload.Value
        };

        return new XmlResult(result);
    }
}

Our input and output models are items easily serializable/deserializable:

public class Payload
{
    public int Value { get; set; }
}

public class Result
{
    public int Value { get; set; }
}

The XmlResult is from
MvcContrib, and encapsulates the serialization for us. However, we don’t have anything to accept XML as an input. We could just accept a string value and do the manual deserialization ourselves, but what’s the fun in that?

We’d also like to have the binding done according to the content type of the request payload, so that “text/xml” is recognized and automatically deserialized, just as “application/json” is currently done out of the box. Using
RestSharp, we want to get this test to pass:

[Test]
public void RestSharp_Tester()
{
    var client = new RestClient("http://127.0.0.1.:33443");

    var req = new RestRequest("Math/Square", Method.POST);

    var body = new Payload
    {
        Value = 5
    };

    req.AddBody(body);

   
var resp = client.Execute<Result>(req);

    var value = resp.Data.Value;

    Assert.AreEqual(25, value);
}

Just to make sure we’re not pulling any punches, here’s the actual HTTP request from Fiddler:

POST http://127.0.0.1.:33443/Math/Square HTTP/1.1
Accept: application/json, application/xml, text/json, text/x-json, text/javascript, text/xml
User-Agent: RestSharp 101.3.0.0
Content-Type: text/xml
Host: 127.0.0.1.:33443
Content-Length: 41
Accept-Encoding: gzip, deflate
Connection: Keep-Alive

<Payload>
  <Value>5</Value>
</Payload>

Not that exciting, I know, but you can see from the request that the content type indicated is “text/xml”. Our model binder should detect this and provide a deserialized object from that XML.

To do this, we’ll first need to build a model binder provider. Model binder providers decide on whether or not for the given type that they can provide a model binder. Instead of looking at the type metadata, let’s look at the content type of the incoming request:

public class XmlModelBinderProvider : IModelBinderProvider
{
    public IModelBinder GetBinder(Type modelType)
    {
        var contentType = HttpContext.Current.Request.ContentType;

        if (string.Compare(contentType, @"text/xml",
            StringComparison.OrdinalIgnoreCase) != 0)
        {
            return null;
        }

        return new XmlModelBinder();
    }
}

We check the incoming request’s content type, and if it matches our “text/xml” type, we return our XmlModelBinder. The XmlModelBinder is rather simple now, shown below.

public class XmlModelBinder : IModelBinder
{
    public object BindModel(
        ControllerContext controllerContext,
        ModelBindingContext bindingContext)
    {
        var modelType = bindingContext.ModelType;
        var serializer = new XmlSerializer(modelType);

        var inputStream = controllerContext.HttpContext.Request.InputStream;

        return serializer.Deserialize(inputStream);
    }
}

We simply build up the built-in XML serializer based on the model type we’re binding to, feeding in the raw Stream from the request. Finally, we need to make sure we add our model binder provider to the global providers collection at application startup (Application_Start):

protected void Application_Start()
{
    AreaRegistration.RegisterAllAreas();

    ModelBinderProviders.BinderProviders
        .Add(new XmlModelBinderProvider());

    RegisterGlobalFilters(GlobalFilters.Filters);
    RegisterRoutes(RouteTable.Routes);
}

This model binder provider could have been provided through the service location option instead of registered manually. With this model binder provider added, our model is correctly bound, and the response returned matches our expectation:

HTTP/1.1 200 OK
Server: ASP.NET Development Server/10.0.0.0
Date: Fri, 24 Jun 2011 01:15:55 GMT
X-AspNet-Version: 4.0.30319
X-AspNetMvc-Version: 3.0
Cache-Control: private
Content-Type: text/xml; charset=utf-8
Content-Length: 178
Connection: Close

<?xml version="1.0" encoding="utf-8"?>
<Result>
  <Value>25</Value>
</Result>

The value coming out is just what was returned from the XmlResult, but what’s neat is that our input model is just a POCO that looks like it could have come from a POST from form encoded values, JSON or XML. In fact, they all work!

With just a few lines of code, we were able to effectively add XML support to our HTTP endpoints. It’s certainly not a full REST framework, but it can serve in a pinch in cases we just need to expose simple endpoints for consumers that want to do RPC but don’t want to go the full SOAP route.

We also leave open the option of supporting alternative content types, all seamless to our controller action (except for content negotiation). All without mucking around with the complications of WCF, using the same deployment, development and configuration model of our normal ASP.NET MVC sites.

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 LightSwitch Hosting - ASPHostPortal :: Using Visual Studio LightSwitch To Create An Application In Under Four Minutes

clock July 5, 2011 05:57 by author Jervis

Visual Studio LightSwitch is a mind-blowing new offering from Microsoft, which is currently available as a public beta. The idea behind LightSwitch is to create data-backed applications without having to write any code. This sounded too good to be true, so I dedicated some time to trying it out. Three minutes and twenty seconds to be precise! Now, you can find these technology on our Shared hosting plan with very reliable and reasonable price.

Here is a screen shot of the application I created - it's a simple email / phone directory for internal use within a company. I figured you'd want to store each person's name, department, email and some phone numbers.



Remember, the entire application took 3:20 to write from scratch - just look at this search screen. I've got my data persisted to a SQL Express database for free. I've got paged results for free, I've got a search box that searches multiple fields for free. I've got the option to export to excel for free. Also note that I've added a "Create New Contact" page and also a "Details" page (you click on the first name) to edit existing records. I did those inside of that 3:20 as well.

What other features do you get for free... well, there is form validation to make sure people enter all the required information when adding a new record and there is even dirty-data checking for free.

So how did I write this application. Here are the details...

Step 1 - What do you want to store

This is the first screen you get. You type in the fields that you want to use in your application. The "Type" is a drop down list that contains handy options like "PhoneNumber" and "EmailAddress" as well as the more traditional number types and strings.



Step 2 - Add a screen

From the view of the data model, you just hit the "Add Screen" button and select from the five available templates. The search data screen is the one I selected for the main view in my application. Then you give it a "Screen Name" and select the "Screen Data" and click on OK.



At this point, you are actually finished - although I repeated this step to add a "Create Contact" screen and a "Details" screen (which also lets you edit the record).

Run up the example and what you have is a fully functional application, persisting its data to a database and validating user input. It's a Silverlight application, so you can run it on the desktop or via a browser.

More Information

You can find out more about LightSwitch on
the official Microsoft LightSwitch site.

Screen Shots

Here are a couple more screen shots that show some of the stuff you get for free when using LightSwitch, like validation messages and dirty-data warnings. Even the theme of the application is free, with it's tabbed interface and simple ribbon bar menu.

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 LightSwitch Hosting - ASPHostPortal :: How to Simplify App Development Using Microsoft Visual Studio LightSwitch

clock July 4, 2011 05:45 by author Jervis

Microsoft's Visual Studio Live! is a developer's conference that is all about development in the Visual Studio environment. Visual Studio Live! Orlando was held at the Hilton Walt Disney World Resort in November 2010. One of the big announcements from this conference was the launch date for Visual Studio LightSwitch. And what now you can get this visual studio lightswitch hosting at ASPHostPortal.com. This article contains brief information about the benefit and the useful of Visual Studio LightSwitch.

Visual Studio LightSwitch is a rapid development environment that gives technical and somewhat technical people the ability to create lightweight, line-of-business applications. While many developers don't think Visual Studio LightSwitch will be useful for creating applications, I think it can be very beneficial to use in the right circumstances. Here are some reasons why.

Right-sized versus enterprise-ready

In recent years there has been a growing philosophy that everything needs to be enterprise-ready. The prevailing thought is that all solutions need to be scalable, flexible, "anything-able." While that is true for anything that really does need to be enterprise-ready, there are situations where enterprise-ready is too much.

Imagine you are a small startup. You are not focused on enterprise-ready. You are focused on getting through your first year. Alternately, you might be an established organization that is considering getting into a new line of business. Focusing on getting something up and running to let your employees share information in a cost-effective way would ensure that you are not risking valuable resources (that is, capital). In today's economy, capital budgets are limited (and nonexistent in some companies).

The best of both worlds

Traditionally, we have seen tools such as Access, Excel and, more recently, SharePoint, act as a useful starting point for a low-cost prototype. The best thing that can be said of those initial forays in developing line-of-business applications is that usually all of the necessary data points have been identified and there is a working prototype. I find that having a working prototype is immeasurably helpful when starting an enterprise application development effort.

While Access and Excel solutions do provide value when moving to the next level of maturation, Visual Studio LightSwitch can provide even more. Since Visual Studio LightSwitch can connect to Microsoft SQL Server or Oracle databases, the application can utilize either of those databases during the initial development.

Visual Studio LightSwitch also generates an ADO.Net Entity Framework (EF) class structure that can be used in the next iteration of development. Finally, the interface is rendered to a Microsoft Silverlight application.

Recently, I had a customer request a simple application for generating quotes for customers and tracking them in a Web format. Taking this use case, it was decided to give LightSwitch a go. We were able to build a working prototype for the need within four hours—complete with the database tables, class structure and Microsoft Silverlight interface. Normally, in a traditional Web development environment, this would have taken close to 40 hours to get to the same point.

Efficiency versus maturation

Some people point out that if this right-sized application is successful, that it will need to be rebuilt, usually from the ground up. While this is mostly true, it's relevant to restate that having a working prototype does reduce the risk (risk=time+money) in starting a new application.

So, would it be more efficient to build the enterprise-ready version of the application first? The assumption there is that you are going to get the application right the first time or that the application will be used for a period of time to recover its return on investment. But aren't those two very big assumptions? Furthermore, aren't those two very expensive assumptions?

Also, it's relevant to say that enterprise software endeavors are never guaranteed successes. We all know the high rate of failure for traditional development, whether it is done using an agile or waterfall approach. Approximately 50 percent of all features are either never used or rarely used. Why not develop those features inexpensively first and then decide what needs to be in your final application? These are the types of benefits Microsoft's Visual Studio LightSwitch can provide, making it something to consider moving forward.



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