views:

235

answers:

2

Hi all.

I am using asp.net 2.0. I have been using asp.net membership provider for user management. But I think this would be more efficient if I could do this without using role and membership provider provided in asp.net. In fact I see bulky markups generated when I add login control, createuser control etc. in an asp.net web page.

By saying user management, I am referring to the overall login, user activity tracking, password reset/retrieval, role management in an asp.net web application. And I want to implement efficient way to accomplish this.

Any suggestion would be appreciated.

+2  A: 

What exactly bothers you? Server-side code, or the HTML which gets served to the client?

If former, then you can implement your own providers or just reinvent the whole system from scratch (which I do not recommend, but it might be worth it in some scenarios).

If latter, just write your own set of controls that use Membership API.

As far as "efficiency" is concerned, you're not clear in what "efficient" means to you.

Anton Gogolev
What Anton said - you haven't defined specifically what bothers you or how its detracting from your user's experience of the site.
Murph
I am concerned with both server side and html:Server side: Each time I use Membership classes, I will be accessing the membership database multiple times [If I am right], e.g. get user by username, check if user is in role admin and then perform some custom database manipulation. Isn't this enforcing at least three times of database access- two times via membership classes and one+ time while addressing my own custom database manipulation coding?And yes, your suggestion to use my own controls for login, create use etc. is welcome. Thank you!
sangam
And two more things: 1. There are more than 5 tables in the database for user and roles2. There are lots of stored procedures added for the sameSometimes the database objects added for membership and roles are quite more than other tables in the database! Isn't this waste of database storage? However, I confess that this particular situation is more elegant with databases having small number of tables and other objects.
sangam
A: 

Most (all?) of the membership controls support templates, which means you can customize the markup they generate to the client.

See this tutorial to get you started: A Crash Course on ASP.NET Control Development: Template Properties

As for the database hits, I don't think it's a huge problem, but if you're concerned I'd suggest load testing it to make sure. Also, if you set CacheRolesInCookie to true, you can eliminate some of those database calls.

Greg