Mar 052013
 

Jeff Graves from OrcsWeb wrote a great blog post outlining the steps for customizing ASP.NET MVC4 validation for CIDR Subnet. While working on a rWhois project, he realized it required writing an ASP.NET MVC 4 based admin portal. Later in the project, he also tackled adding validation to inputs. Adding validation to an MVC model is super-simple with Data Annotations. By adding these annotations to your model, both client and server-side validation comes to life. If you’re working with MVC4, you’ll find this link very helpful! http://jeffgraves.me/2013/02/26/asp-net-mvc-4-custom-validation-for-cidr-subnet/

If you’re looking for an affordable and dependable host with ASP.NET, check out www.Cytanium.com.

Sep 112012
 

The following link is a fantastic resource for ASP.NET developers which breaks down the process of deploying to IIS on your local computer for testing and then to a third-party hosting provider. You’ll run through 12 tutorials designed to be used in sequence, a bonus troubleshooting page, and tips and tricks along the way!

http://www.asp.net/mvc/tutorials/deployment/deployment-to-a-hosting-provider/deployment-to-a-hosting-provider-introduction-1-of-12

May 162012
 

Cytanium - a newly launched discount shared hosting venture backed by OrcsWeb – has an extremely functional and usable control panel. One of the many features it has is the ability to leverage Microsoft’s Web Application Gallery (WAG) to automatically install dozens of different free applications. Just to show how easy is it, I grabbed some screenshots of me stepping through the process to install Orchard CMS on my Cytanium hosting account…

Cytanium's hosting control panel

The icon to enter the Web Application Gallery is located right in the main interface of the Cytanium hosting control panel. Once in the WAG part of the control panel, all of the available applications are listed alphabetically. You can change the drop-down list to narrow down the selection, or just scroll through the different pages to see all the options.

Cytanium's hosting control panel

Once I found Orchard CMS in the list, I can click on the name of the application or I can click Install right from the result list.

Cytanium's hosting control panel

The first screen before the download and install actually kicks-off just gives a short summary about the application chosen. Click next to begin the download.

Cytanium's hosting control panel

You’ll then get a dialog box showing that the application is being downloaded from the vendor to your hosted site on the server.

Cytanium's hosting control panel

After the download you are prompted for some basic installation parameters. (NOTE: Orchard CMS supports SQL CE but the WAG doesn’t yet, so installation through the WAG requires SQL Server 2008. To use SQL CE I’d recommend downloading to WebMatrix then using Web Deploy to publish up to the server. Not ideal because of the extra steps, but it is fairly easily and works great!)

Cytanium's hosting control panel

Wait a short few moments while it installs.

Cytanium's hosting control panel

And that’s it!

Cytanium's hosting control panel

You can now click on the link to launch Orchard CMS which has its own configuration wizard to finalize its setup.

Happy hosting!

Apr 172012
 

Here at Cytanium we love new technologies and we strive to integrate them as fast as reasonably possible. We also like to include our clients when possible so that they (you) can get familiar with the latest and greatest web development options – like ASP.NET 4.5!

Today we are pleased to announce the offer for a FREE ASP.NET 4.5 Beta hosting account for testing purposes. This gives you a risk-free way to test out and play with the latest vNext options from Microsoft - Visual Studio 11, ASP.NET 4.5, Web Pages 2 and MVC 4.

Please note that this is a BETA release and related to that, support is limited. This is a great way to migrate and test your existing code, or start testing new code, against this latest platform. This is not intended for production support though so do not place anything on the free testing account that you cannot afford to lose. This promotion may change or end with very short notice and accounts + data may also be removed at that time, so please retain your own backups and use this only for the intended testing purposes.

Now that we have that disclaimer out of the way, how about getting started? Just click this link to get your FREE ASP.NET 4.5 Beta Test Hosting account. (NOTE: The .NET extension in the control panel will reflect “4.0″ but it is indeed 4.5 – it’s just that the panel doesn’t have 4.5 officially baked-in as an option yet.)

Here are a couple of links you may find useful:

What’s New in ASP.NET 4.5
http://www.asp.net/vnext/overview/whitepapers/whats-new

Application Compatibility
http://msdn.microsoft.com/en-us/library/hh367887(v=vs.110).aspx

If you haven’t already downloaded Visual Web Developer 11 BetaVisual Studio 11 Ultimate Beta, and/or ASP.NET MVC 4 Beta for Visual Studio 2010 – click the corresponding link to get started with those tools and technologies on your local development machine.

If you want some great production-ready hosting for your live site, check out our Site Hosting and Windows VPS Hosting (starting at only $20!) options.

Happy hosting!

Mar 262012
 

A while ago I wrote an article on code you can use to send email using ASP.NET C#. That article assumed that the local SMTP service was allowing anonymous relay for code on the local server (i.e. 127.0.0.1). Below is a revised sample demonstrating how to code for authentication against an SMTP server if your server has that feature enabled to prevent (or at least track) spam from on the local server.

sendmail.aspx

<!DOCTYPEhtmlPUBLIC"-//W3C//DTD XHTML 1.0 Transitional//EN""http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<htmlxmlns="http://www.w3.org/1999/xhtml">
<headrunat="server"><title></title></head>
<body>
    <form id="form1" runat="server">
    <div>
        Message to: <asp:TextBoxID="txtTo" runat="server"></asp:TextBox><br/>
        Message from: <asp:TextBoxID="txtFrom" runat="server"></asp:TextBox><br/>
        Subject: <asp:TextBoxID="txtSubject" runat="server"></asp:TextBox><br/>
        Message Body: <br/>
        <asp:TextBoxID="txtBody" runat="server" Height="171px" TextMode="MultiLine" Width="270px">
        </asp:TextBox><br/>
        <asp:ButtonID="Btn_SendMail" runat="server" onclick="Btn_SendMail_Click" Text="Send Email"/>
        <br/>
        <asp:LabelID="Label1" runat="server" Text="Label"></asp:Label>
    </div>
    </form>
</body>
</html>

sendmail.aspx.cs

using System;
using System.Web.UI.WebControls;
using System.Net.Mail;

publicpartialclass SendMail : System.Web.UI.Page
{
    protectedvoid Btn_SendMail_Click(object sender, EventArgs e)
    {
        MailMessage mailObj = new MailMessage(
            txtFrom.Text, txtTo.Text, txtSubject.Text, txtBody.Text);
        string userName = "ftpUser";
        string password = "ftpPassword";
        SmtpClient SMTPServer = new SmtpClient("localhost");
        SMTPServer.Credentials = new System.Net.NetworkCredential(userName, password);
        try
        {
            SMTPServer.Send(mailObj);
            Label1.Text = "Sent!";
        }
            catch (Exception ex)
        {
            Label1.Text = ex.ToString();
        }
    }
}