Why LoginView is designed wrong

...or if it's not designed wrong, it addresses the wrong business problem.

Every ASP.NET developer has been there before. Some sections of a form should be shown to some people or anon users. You probably tucked the portions of UI into Panel controls and set their visibility properties based on the login status of the user.

So along comes LoginView, presumably to address this problem, only the controls within each template can't be accessed. As someone mentioned in my previous entry on the subject, this is by design. The controls are created after the PreRender event.

That's a pretty stupid design.

At that point, I can't do anything with the content inside of them. Postback events have long since fired. Honestly, how is this useful? Some might argue that it's like the controls you create in a grid or repeater, but this isn't like that at all because you'll never have the same template rendered more than once in a LoginView.

I sure hope they change this before the next beta.

2 Comments

  • That is disappointing. The LoginView looked real handy. If my controls aren't available to me then its just stupid. It doesn't seem like it would be that complicated to make it work the way we all expect it.

  • I'm kind of taking the view that the Whidbey release is a two progned beast. It has Generics,Iterators,anonymous methods et al for the purist programmer, then it has all these Easy peasy controls that my Mom could build a web site with. I'm tending to regard these new controls with a view of never using them, as you just don't have full control over your data flow. I may use an objectdatasource at best, but can I trust the SqlDataSource to flow my data in the best possible way, or should I be using it just because it's quick and dirty and makes life easier. The objectdatasource creates a new instance of your object for every method invocation, probably not a major problem in the greater schema of things, but I could develop a flow that perhaps just held one reference that holds some state between calls for example. I can't argue that these controls are neccessarily bad, just that perhaps they should be used judiciously. I just don't like full control being removed from my fingetips, and I really look forward to other peoples comments on the new controls.

Comments have been disabled for this content.