Running ASP.NET MVC 3 on Azure

If you have successfully installed an app running MVC 2 on Azure, and then try to upgrade it to MVC 3, you might run into some troubles. What might help is to ensure that you have also deployed the new assemblies. MVC 2 is part of .NET 4.0, and its assemblies are included in the standard Azure image, but the new ones aren’t. You have to deploy them yourself. They won’t get deployed by default because they Read post »

AJAX history with ASP.NET AJAX 1.0

If you are still using the original ASP.NET AJAX 1.0 release, you may be looking for a way to use .NET 3.5 SP1′s “history” feature of the ScriptManager control. A while back, Nikhil Kothari wrote a component called UpdateHistory, which looks like what was integrated into 3.5 SP1. It certainly solved my problem. Combine it with HttpUtility.ParseQueryString and you’re onto a winner! Read post »

Declarative data binding on User Controls

I had this problem a few years ago and figured that there was no good solution, but I am older and wiser now so figured it’s time look for a better solution. I have a GridView, and inside the ItemTemplate I call one of my own UserControls: <asp:GridViewID="grdMessages"runat="server" ... > ... <ItemTemplate><uc1:EmailAddressID="EmailAddress1"runat="server" DataSource='<%# (MailAddress)Eval("FromAddress") %>'/>ItemTemplate> ... asp:GridView> But the DataSource property of the EmailAddress user Read post »

ObjectDataSource.SelectCountMethod wants an int

I have been working with the GridView ASP.NET control today, bound to an ObjectDataSource. This is to do with my experiment with DBMail that I mentioned the other day. It wasn’t working. I couldn’t find a solution on the net. By chance, I changed this: class DatabaseSource { long _messageCount = 0; public List GetMessages(long startRow, int pageSize) { Database db = new Database(); List messages = db.GetMessages( startRow, pageSize, out _messageCount); return messages; } publiclong GetMessageCount() { return _messageCount; } } into this: Read post »