Arun Stephens

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 are in the GAC. Read more →

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 more →

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: «/span>asp:GridViewID=“grdMessages”runat=“server”… >… «/span>ItemTemplate>«/span>uc1:EmailAddressID=“EmailAddress1”runat=“server”DataSource='<%# (MailAddress)Eval(“FromAddress”) %>'/></ItemTemplate>… </asp:GridView>But the DataSource property of the EmailAddress user control is never set. If I have a plain <%# Eval(“FromAddress”) %> right next to the <uc1:EmailAddress /> tag, the literal evaluates properly. Read more →

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: classDatabaseSource { long_messageCount = 0; publicListGetMessages(longstartRow, intpageSize) { Database db = newDatabase(); Listmessages = db.GetMessages( startRow, pageSize, out_messageCount); returnmessages; } publiclongGetMessageCount() { return_messageCount; } } Read more →