If you want to add Membership Provider features to your WebHost4Life application, I've found that you can't use the aspnet_regsql wizard UI. Instead, use the following code at the command prompt:
aspnet_regsql -C "Data Source=sqlNNN.mysite4now.com;Initial Catalog=yourdb;User Id=yourUserName;Password=yourPwd" -A mr
Replace NNN with your assigned address, and obviously replace the other elements of the above connection string, too.
At the risk of having my Apple fanboy status revoked, I have to say that I find the iPhone lacking. It seems that Apple has released a half-finished product upon the masses, and the masses have spoken in hypnotized unison that they think Apple can do no wrong. Oh, sure, I was seduced at first. Visual voicemail is pretty cool. The flicking and gesturing for the UI is even wicked hot. In short, the attention to detail on the things that are implemented are first-class.
So why the negative finding? Sure, most, if not all, of these things are fairly well-known, but they do impact my day to day life.
- I have a Motorola S9 headset that doesn't work with the iPhone. Sure, phone calls can come through, but not music. Requiring an AD2P Bluetooth adapter is just plain stupid, given that the iPhone is supposed to be the pinnacle of form and function. Sorry, no. It gets a miserable failing grade.
- How is it that a device manufactured in 2007/2008 could come without cut/copy/paste?
- No speed-dial. I might be safe in saying that every phone on this planet, with the possible exception of 1950s rotary dial phones, has the capability to speed dial by pressing one button. Not so for the iPhone!
- Ok, maybe speed-dialing is so 1999, and we don't need it because the iPhone is a full-fledged multimedia experience. Fine theory, but the reality is you can't even do voice dialing! Let me take my Bluetooth headset (but not my Motorola S9!!), and - wait, I can't actually do anything with it. I need
to take my iPhone out of my pocket, press like 4 things, and THEN I can start a conversation. I wonder if that will comply with all of those laws requiring hands-free cell phone use popping up all over the nation.
- The fact that I need to buy extra accessories to get my iPhone to work. The headphone jack was recessed for that full-flush feeling. My existing mini-RCA jack doesn't let me keep continuous playback, my Griffin FM transmitter turns my phone off, and my headphone Y-splitter isn't deep enough. At least my USB charger works.
- The World Clock doesn't allow you to add cities. It wouldn't be a big deal to add the exact city you want if we could actually access the underlying OS files.
- I'd like a much better user experience to sort, filter, and search my contacts. Using the Categories I've already assigned would be a good start. Maybe I'm just missing something here.
- No ToDo list, nor integration to any GTD system, or any system for that matter. Which brings us to...
- The Missing SDK. It's late. I don't know what to expect here, and I think Apple prefers it that way. I'll leave out the glaringly obvious fact that the SDK should have been released on Day 1. Oops. I guess I won't.
I'll be working hard over the next couple of weeks to try to remedy the list above, and if I make any significant progress, I'll be sure to post here. Feel free to comment if you have any suggestions.
Here's a quick linkblog post because I needed to copy some files from my local drive to a remote desktop computer, and this blog
entry spelled it out quite effectively.
Problem: I have written my own membership provider to store and validate user information. Further, I have a web page that allows a user to come and sign up with a username, password, and a whole host of other client-related data. When the user submits that data, I would like to have them logged in.
Solution: Since I'm using Forms authentication for the ASP.NET website, it appears that the following code-snippet does what I want:
if (Membership.ValidateUser(u.UserName, u.Password))
Nikhil Kothari wrote a brilliant blog post titled Ajax with the ASP.NET MVC Framework. In that post, he built a demonstration TaskList application that used Ajax and the ASP.NET MVC framework that Microsoft is working on. Microsoft is doing a good job in releasing more frequent updates to this framework, but that means that there will be pain when moving from one release to the next. The ASP.NET MVC Preview 2 release was no exception to this rule. There were a list of documented, tedious and manual steps that one needed to follow to get their old code running with preview 2: update web.config, change the route description, update assembly dependencies, etc.. There were also other items that were not so well-documented: add ProjectTypeGuids to the csproj file, methods that fell out of the preview 2 release (e.g. ViewFactory.CreateView), etc.
I updated Nikhil's code, and some basic testing shows me that it's working with the preview 2 bits. Download the updated code here. Please leave a comment or send me an email if you see any errors that need to be corrected.
ASP.NET MVC Preview 2 was released yesterday. I've had a chance to install and play with it, and I hate to report that I am underwhelmed. My thinking leads me to believe that MS rushed this release out the door just to be able to say they shipped something at MIX. While there has been good progress made on several issues (e.g. medium-trust support, public methods are callable by default, and route setup is improved). However, I find several other things lacking, referenced from ScottGu:
- Source code is not released. Sure, it might be coming "soon", but why not have everything coordinated and ready to go? Hitting an arbitrary deadline of "ship while at MIX" is less important to me than having answers to questions like these.
- Dynamic Data (scaffolding) will not work with Preview 2. It is almost always inexcusable to take functionality and features away. The ability to scaffold is one of the coolest things in Rails. Having something similar in ASP.NET was a welcome treat. Now it's gone. Again, I'm sure there is something that will be released "soon", but why not have everything ready to go? I hate not only playing catch up years later, but having a taste of it, only to have it yanked a few weeks later.
- The "choose your unit testing framework" feature that was hyped up ships with only MSTest enabled. I understand that MS is working to enlist support from the various unit testing groups to add their tool to the list, but it seems disingenuous to post mocked up screen shots with test frameworks in a combo box that were never developed.
- Others have pointed out some more detailed issues that need solving to help with testability (e.g. see here and here).
I look forward to seeing these issues addressed ASAP because I absolutely LOVE the promise that the MVC bits hold.
All in all, I was very pleased with the inaugural meeting of the Milwaukee ALT.NET group. We had a turnout of 10 people, which exceeded my expectation in quantity, and the quality was quite good, too. We talked about general architecture topics for about 45 minutes, and then Todd Penland led the group in discussion on persistence and the Unit of Work pattern. We talked about various alternatives to building this yourself (e.g. NHibernate), and talked about the pros and cons of this approach (i.e. requiring a topological sort to deal with database changes properly (something near and dear to my heart from when I was writing code for MIDAS/DataSnap and BDP), handling object graphs, requiring a MarkDirty() call in the property setters, etc.). It was a very engaging discussion. Thanks to everyone who showed up, and to SpiderLogic for providing the refreshments.
Here are the details for next month:
When: Wednesday, April 9, 2008 @ 7pm
Where: 10000 Innovation Drive, Suite 260 (SpiderLogic office)
What: Dan Piessens (who is on the advisory panel for Unity
and EntLib 4.0
) will cover Unity and EntLib 4.0
I'm looking forward to it, and hope you are, too. If you're planning on being there, please send me an email to firstname.lastname@example.org, or leave a comment here. That way I can plan the food and refreshments accordingly. Feel free to drop me a line on topics you'd like to see covered, too.
Updated to change the date to April 9th. This date change will allow us to hopefully get more exposure thanks to Scott Isaacs and the WI .NET User Group. Thanks, Scott!
A co-worker of mine, Brian Kapellusch, is working on a web framework to give us a garden path for ASP.NET applications. The code that he's writing (and the code to use it) is trés elegant. One of the underpinnings of this framework is his use of the ObjectDataSource class (ODS). I am making heavy use of NHibernate and Spring.NET in this application as well. My understanding of the ODS told me that if I wanted to control how the source object was created, that I simply needed to handle the ObejctCreating event and assign the desired object instance in that event to e.ObjectInstance (see here for some more usage examples).
However, it turns out that is not enough to fully control when an object gets created. If you set the TypeName property to a concrete class, ODS will also create a new object behind the scenes - even if you have handled the ObjectCreating event. This becomes very problematic when using an IoC container to automatically build up and inject properties into your class.
The bottom line is this: If you see one version of your object that has things built up properly (because the IoC container was used properly), and one version that has null properties (because, in essence, ODS called "new MyClass()" for you, which doesn't let the IoC container do it's job), you should change the TypeName to point to the interface type instead of the concrete class type. Much thanks to Brian for this one.