simon-holman.net
ASP.NET, ASP.NET MVC, DotNetNuke and Web Hosting
ASP.NET, ASP.NET MVC, DotNetNuke and Web Hosting
Aug 31st
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
Aug 17th
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>
Aug 15th
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"; }
Jul 21st
We have released the Expeed customer forums at http://forum.expeed.com.au
Feel free to drop by and have a chat.
May 6th
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
Apr 21st
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.
Apr 20th
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.
Apr 15th
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:
Phil Haack’s MVC intro at PDC 08
Attached Files
Apr 14th
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
Apr 13th
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:
The IDE looks clean and tidy with a new default font and great code colouring
For more info on Visual Studio 2010 visit: