simon-holman.net

ASP.NET, ASP.NET MVC, DotNetNuke and Web Hosting

Follow me on TwitterRSS Feeds

  • Home
  • About
  • Photos
    • Las Vegas
  • Contact Me
  • Sitemap

High Availability Virtual Servers now at Expeed

Aug 31st

Posted by Simon Holman in Web Hosting

No comments

Expeed are very pleased to announce the release of our latest product, High Availability Virtual Servers.
Our High Availability Virtual Servers run on enterprise grade Dell Servers and SAN equipment. We utilise Microsoft Failover Clustered Hyper-V Hosts all managed by the Microsoft System Centre Management Suite.
High Availability Virtual Servers are designed for mission critical and high traffic websites that need to enure the highest levels of uptime. Our Hyper-V cluster allows live migration of virtual servers to alternate hosts for the purposes of Host maintenance and in the event of a hardware failure.

Existing VPS customers are able to upgrade their VPS’s to High Availability at any time. Please contact us on sales@expeed.com.au to discuss your options.
For more information and product pricing please visit http://expeed.com.au/hosting/high-availability-virtual-servers

Clustering, High Availability, Hosting, Hyper-V

Textboxes Timers and Updatepanels

Aug 17th

Posted by Simon Holman in ASP.NET

No comments

In a project I’m working on, I had to create a Facebook style notification system. I wanted the user to be able to enter a status and click the add button and have the list of notifications below it update with their most recent post. That is simple enough to do, all I had to do was to add the notification, clear the textbox then call the updateNotifications function in my button_click code behind method. This all had to be very smooth to the eye so i added the usual updatepanel around the textbox, button and div that listed the notifications.

As well as that, I also wanted the notifications system to automatically update with other users notifications within the same group. So I added a Time control to the mix and set it to refresh the notifications list every 10 seconds.

This seemed to work well until I was half way through typing a new notification when the timer triggered and refreshed the notification list. As the textbox was inside the updatepanel it stopped letting me type any text while it refreshed.

So then I thought that I’d move the textbox outside the updatepanel so it wasn’t impacted when the timer refreshed the list.

The only problem now is that because the submit button to add a new notification was inside the updatepanel and the textbox was outside the updatepanel the textbox could no longer be cleared on the partial postback. My txtNotification.Text = String.Empty; was being ignored.

I can’t quite remember the next thing I tried but it obviously didn’t work because now the whole page was refreshing everytime the timer triggered.

In the end I remembered about the UpdateMode property on the update panel. I set the updatemode to conditional around my textbox/button updatepanel and always on the notification list/timer updatepanel. That way the timer triggers updated the notification list without upsetting the textbox and submitting the add button updated the list and cleared the textbox. Perfect result.

ASPX code:

<asp:UpdatePanel ID="updStatusUpdate" runat="server" UpdateMode="Conditional">
    <ContentTemplate>
        <asp:TextBox ID="txtStatusUpdate" runat="server" TextMode="MultiLine" Rows="2" Width="570"></asp:TextBox> <br />        

        <asp:Button ID="btnAddStatusUpdate" runat="server" Text="Update Status"
            onclick="btnAddStatusUpdate_Click" class="ui-state-default ui-corner-all"/>

    </ContentTemplate>
</asp:UpdatePanel> 

<asp:UpdatePanel ID="updNotifications" runat="server" UpdateMode="Always">
    <ContentTemplate>
        <div class="NotificationList">
            <asp:Literal ID="litNotifications" runat="server"></asp:Literal>
        </div>
        <asp:Timer ID="Timer1" runat="server" ontick="Timer1_Tick" Interval="10000"></asp:Timer>
    </ContentTemplate>
</asp:UpdatePanel>    
Ajax, ASP.NET, C#

A function to convert a TimeSpan to an x minutes ago string

Aug 15th

Posted by Simon Holman in ASP.NET

2 comments

An application I’m working on requires a facebook style status system and I thought it would be good to include the “posted x minutes ago” text after the status.

I’m sure my code is not the most elegant solution but it works so I thought I’d share.

public static String LastUpdatedText(DateTime DateNow, DateTime LastUpdated)
        {
            TimeSpan timeDiff = DateNow.Subtract(LastUpdated);

            if (timeDiff.TotalHours < 1)
            {
                return Math.Round(timeDiff.TotalMinutes,0) + " minutes ago";
            }

            if (timeDiff.TotalHours < 24)
            {
                return Math.Round(timeDiff.TotalHours, 0) + " hours ago";
            }

            if (timeDiff.TotalHours < 48)
            {
                return "yesterday";
            }

            if (timeDiff.TotalHours < 168)
            {
                return Math.Round(timeDiff.TotalDays,0) + " days ago";
            }

            if (timeDiff.TotalDays < 42)
            {
                return Math.Round((timeDiff.TotalDays / 7),0) + " weeks ago";
            }

            if (timeDiff.TotalDays < 365)
            {
                return Math.Round((timeDiff.TotalDays / 30),0) + " months ago";
            }

            return Math.Round((timeDiff.TotalDays / 365),0) + " years ago";
        }

ASP.NET, C#

Expeed Customer Forums now available

Jul 21st

Posted by Simon Holman in Expeed

No comments

We have released the Expeed customer forums at http://forum.expeed.com.au 

Feel free to drop by and have a chat.

Expeed, Feedback, Web Hosting

DotNetPanel released as open source

May 6th

Posted by Simon Holman in Web Hosting

1 comment

On 20/04/2010 SMB SAAS Systems Inc. released the full source code for their DotNetPanel control panel as an open source product named WebsitePanel.

See the announcement from SMB SAAS Systems Inc CEO Feodor Fitsner below

We are excited to announce that SMB SAAS Systems Inc. has revised theDotNetPanel codebase and posted that new code under the new name "WebsitePanel" to SourceForge.NET as an open source project:

http://sourceforge.net/projects/websitepanel

WebsitePanel is a line-of-business application and we recognize the benefits of using an open source development model as a more agile and flexible way to meet the growing needs of the web hosting community.

This will enable the hosting and development community to directly contribute to the future of the project, ensuring WebsitePanel’s continued development as an affordable and scalable control panel for Microsoft Windows hosting.

With this change, software developers and hosting providers can now easily integrate WebsitePanel directly into their own offerings and extend the functionality and features to meet their customers’ Windows hosting needs.

For current DotNetPanel customers SMB SAAS Systems Inc. will be providing free community support for a limited time. Future new versions and product updates (including enterprise modules) and bug fixes will be available at no cost to all customers via the WebsitePanel open source project.

We encourage all our customers to move to the WebsitePanel, which will continue to be supported, and participate in WebsitePanel project at SourceForge.NET.

We enjoy working with you and look forward to seeing WebsitePanel continue to grow!

Sincerely yours,
Feodor Fitsner,
CEO and President

DotNetPanel, Web Hosting, WebsitePanel

Telerik ASP.NET MVC controls and jQuery

Apr 21st

Posted by Simon Holman in ASP.NET MVC

No comments

For those who are using the Telerik controls for MVC you will most likely have the following somewhere on your page or Master page

<%= Html.Telerik().ScriptRegistrar() %>

This will create issues if you then try to add any jQuery to the page including jQuery plugins.

To get around this, you can append a method to the Telerik ScriptRegistrar to disable the jQuery reference. You need to change it to

<%= Html.Telerik().ScriptRegistrar().jQuery(false) %>

And your page should be happy again.

ASP.NET, ASP.NET MVC, jQuery, Telerik

Getting random records from a table using LINQ to SQL

Apr 20th

Posted by Simon Holman in ASP.NET MVC

No comments

I needed to get a number of random records from a table and a quick google search led me to http://mosesyap.com/BlogWeb/post/2008/07/C-Getting-a-Random-Record-from-a-Table-inside-the-SQL-Server-Database.aspx

This is a very quick and easy mechanism to use and will work on any table.

To load a specific number of random records change the .First() function

DataContext db = new QuoteDataContext();
var quote = db.Quote.OrderBy(q => db.GetNewId()).First();

to be .Take(x)

DataContext db = new QuoteDataContext();
var quote = db.Quote.OrderBy(q => db.GetNewId()).Take(x);

replacing x with however many records you need.

ASP.NET, ASP.NET MVC, LINQ

ADNUG Presentation Apr 14 2010 ASP.NET MVC

Apr 15th

Posted by Simon Holman in ADNUG

No comments

Well I presented at the ADNUG (Adelaide .NET User Group) last night on the topic of ASP.NET MVC.

Only a few of the attending audience had used MVC and there seemed to be a genuine interest in the technology.

As we were running a bit late there were a few items that I didn’t get to cover and there are certainly areas that can be expanded upon further. If there is interest within the group I’m happy to return to go through more on MVC.

I have attached the solution file that I was working on last night. I have added the SQL db to the application which should make loading and running it easier.

I have also added the Edit functionality for the customer records to show how to handle a form postback.

You will need Visual Studio 2010 to run this application. I believe the Express Edition will be sufficient.

Some excellent ASP.NET MVC resources can be found at:

ASP.NET MVC

Phil Haack’s MVC intro at PDC 08

Phil Haack’s Blog

Scott Guthrie’s Blog

Attached Files

ADNUGMVC

ADNUG, ASP.NET MVC

Presenting tonight at ADNUG

Apr 14th

Posted by Simon Holman in ADNUG

1 comment

I will be presenting on ASP.NET MVC at the ADNUG meeting tonight.

Details below:

ADELAIDE DOT NET USERS GROUP.

The next meeting of ADNUG will be held on WEDNESDAY 14h April at 5.45pm at
SA Innovation Centre , Level 2, Westpac House, 91 King William Street, Adelaide .

Visitors welcome.

PROGRAMME

5.45 pm Finger food an Drinks. Join with us for a drink and pizzas – members free – visitors $5.

6.15 pm What’s New – New developments and releases

6.30 pm Simon Holman  ASP.Net Developer  Using ASP.Net MVC 2.0

7.30 pm Meeting close

ADNUG, ASP.NET MVC

Visual Studio 2010 Released

Apr 13th

Posted by Simon Holman in Visual Studio 2010

No comments

Unless you’ve been living under a rock for the past few weeks, you’ll know that Visual Studio 2010 was officially released today.

I’ve been running the RC version and was keen to download and install the release version and really getting busy with the new features.

Scott Guthrie posted an excellent post on his blog listing the new features in VS 2010 and .NET 4. If your not an MSDN Subscriber I recommend downloading the Express edition here.

A few of my favourite features are:

  • new IDE look and feel. I especially like the code optimised view. I’m a big fan of seeing as much code as possible. I do very little work in design view with web forms so it works well and is great for MVC projects as well.
  • Multi monitor support. I don’t have multi monitors yet as I have a laptop and I output that to a 24” LCD. When it’s time to move on from the laptop I think I’ll go back to a desktop with dual monitors
  • HTML and Javascript snippet support. Try typing “<a” (without the quotes) and tabbing twice. You’ll get “<a href="#">content</a>” prefilled for you with the cursor after the # ready to type. Also try “<act” in an MVC app to get “<%= Html.ActionLink("linktext", "actionname") %>”
  • MVC 2.0. Some fantastic enhancements over MVC 1.0
  • Automatic HTML encoding using the <%: %> syntax.
  • Clean web.config files.

The IDE looks clean and tidy with a new default font and great code colouring

image

For more info on Visual Studio 2010 visit:

http://msdn.microsoft.com/en-gb/vstudio/default.aspx

http://weblogs.asp.net/scottgu/default.aspx

ASP.NET, ASP.NET MVC, Visual Studio 2010
12»
  • Categories

    • ADNUG (2)
    • ASP.NET (3)
    • ASP.NET MVC (7)
    • DotNetNuke (2)
    • Expeed (2)
    • Visual Studio 2010 (1)
    • Web Hosting (3)
  • Blogroll

    • Expeed Technology
    • Facebook
    • Stack Overflow
    • Twitter
  • Tags

    ADNUG Ajax ASP.NET ASP.NET MVC Bookmarkit C# Clustering DotNetNuke DotNetPanel Expeed Feedback High Availability Hosting Hyper-V jQuery LINQ Networking Telerik VB.NET Visual Studio 2010 Web Hosting Web Services WebsitePanel Windows Services
  • My latest tweets

    Loading tweets...
    Follow me on Twitter!
  • User Login






    • Lost your password?
Mystique theme by digitalnature | Powered by WordPress
RSS Feeds XHTML 1.1 Top