Javascript Overload

Posted September 25th, 2008 in Uncategorized by Alex Barberis

I came across this great article at Smashing Magazine with links to a bunch of javascript controls. There are many great implementations of MooTools and jQuery. You can see the article.

I’m really into all the Mac-like script effects people come up with. Here are some of my favorites:

Slider Gallery (looks like the top portion of apple.com that lets you scroll through product lines)

OS X Style Dock

It’s amazing how script has transformed the web so much in the last few years. I’d hate to think where we would be without it.

ASP.NET Membership and Profile Providers

Posted December 14th, 2007 in asp.net, webdev by Alex Barberis

This is something that I really overlooked with all the ASP.NET stuff I’ve done. I was messing around with a ASPNET 2.0 project and discovered this great mechanism that saved me from writing tons of code. Basically you setup a few tables on your SQL database, edit your web config with a connection string to that database and you’re done. Now you have a project with the ability to create users and store their profiles and you still haven’t written a line of code. I’m kind of suprised I blew this off for as long as I did.

Here are the technical details for anyone looking to implement this on a site. I looked around and pieced it together so this is all you need to do.

First run “aspnet_regsql.exe -W” to setup your database schema. (I added the tables to an existing database rather than seperating it)

Next, make changes to your web.config to point at the database.

Add the connection string (connectionstrings section):

name="LocalSqlServer" connectionString="User ID=USER;Password=PASSWORD;server=HOST;database=DB_NAME"

Point the providers to the connection string (system.web section):

Membership provider:

  1. <profile>
  2. <providers>
  3. <remove name=”AspNetSqlProfileProvider”/>
  4. <add name=”AspNetSqlProfileProvider” type=”System.Web.Profile.SqlProfileProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a” connectionStringName=”LocalSqlServer” applicationName=”APP_NAME”/>
  5. </providers>
  6. <properties>
  7. <add name=”Property1″/>
  8. <add name=”Property2″/>
  9. </properties>
  10. </profile>

The membership provider lets you specify options about password and lockout security. The options are pretty self explanatory. Another cool thing I found was you can add the properties and you get intellisense on these fields when you are storing profile information.

Finally, write some code! You’re all done setting this up.

Adding a user is as simple as:

Membership.CreateUser

Combine this with the Create User Wizard and you’re creating users on a site in minutes.

When you want to store user profile information just use this:

Profile.Property1 = "foo"

Note: If you need to pull this data from a procedure or anything behind the scenes in your database beware that the profile provider stores all profile information for a user in a single row. It stores everything in a text field with delimiters to tell where the next profile property starts. You might want to edit a procedure and put the stuff into seperate rows or whatever your application requires.

These providers all integrate with Login suite of controls in ASP.NET. So far I’ve used the Login Name and Login Status controls. It’s been pretty drag and drop so far. If I have time I’ll try to post some tips about the other controls I use.

I know in the past I’ve had to create complex user creation and security mechanisms on sites. I feel like I wasted a lot of time now! :) Well, this won’t work for all sites but I’m sure with a little customization it can cover a large portion of sites. I hope this helps someone out who has any questions with this. If you have any specific questions or comments please let me know.

Enjoy!

Speed up those .NET User Controls

Posted January 9th, 2007 in asp.net, dotnet, webdev by Alex Barberis

I found an interesting article on Rob Gruen’s blog that helped speed up the loading time of a user control. Apparently adding the following lines to the constructor of your user control resolves some deadlock in the framework related to a timeout looking for a new version I guess… This problem seems to be specific to hosting user controls in IE.

I’ve been using this for a while now and it seems to work well. A full explanation is available on his site.

   1:  System.Configuration.ConfigurationSettings.GetConfig("simple text")
   2:  Dim a() As String = Environment.GetCommandLineArgs()
 

Enjoy!

ASP.NET 2.0

Posted November 24th, 2006 in ajax, asp.net, webdev by Alex Barberis

I figured I would post about my first use with the new Visual Studio and its version of ASP.NET. Let me start off by saying I am very impressed. I’m always the last one to bash Microsoft about their product (at least the development portion). As far as I’m concerned, Microsoft has provided me with a good development toolset to accomplish what I need to.

I got to work in the new studio for some work related stuff and boy was I impressed. Is it just me or the speed of that IDE is *very* fast? Granted I was working on a small web project but the UI felt so snappy and responsive. Even something simple like working on template columns in a grid was greatly improved. I found myself not having to revert between HTML and design view so much. The ASP.NET team definetly cleaned up the weak parts of the product.

I’ve been working on a few side projects messing around with ASP.NET 2.0, especially the “Atlas” framework (or whatever they want to call it this week). Looks like some very cool stuff to me.

This is some of the first free time I’ve had lately to put a post up on here. I’ve been working on pinball machines a lot lately and just working in general. It looks like I’ll be visiting St. Louis pretty soon, gotta find some interesting stuff to do while I’m there. I think it’s time I crash now since I’m stuffed from Thanksgiving. I have to go find some pumpkin pie tomorrow, there was none at the family dinner. Bummer!