Posted on October 16th, 2006%
Since working with ASP.Net 2.0, I’ve been using the included Membership API almost exclusively. There was one piece of it I was never crazy about: the autogenerated passwords created by the SqlMembershipProvider (and, presumably, other providers).
Let me rephrase that. I didn’t have a problem with the auto-generated passwords, which included many symbol characters. For me, it was simple enough to copy/paste the autogenerated password (which would look something like this: @eyue@^%#), log in, then change the password to something more memorable.
Unfortunately, I am not a good representative sample of the typical web user, and eventually I heard my clients complain about the “overly complex” autogenerated passwords. Despite the explanations of an easy workaround (copy and paste) and the added benefit of the complex passwords (more security), clients still complain.
I came up with a quick way to hack the SqlMembershipProvider to generate less complex passwords, and it was as simple as creating a new provider class that inherits . . .
→ Read More: Changing the autogenerated password format in the SqlMembershipProvider
Posted on September 19th, 2006%
On September 6, the guys at Microsoft released the second beta version of their CSS Friendly ASP.Net 2.0 Control Adapters. In addition to bug fixes were CSS implementations of the membership controls – specifically, the Login, CreateUserWizard, PasswordRecovery, LoginStatus, and ChangePassword controls.
Unfortunately for the membership controls, it didn’t really work. This bothered me, because I’ve been using a hacked version of these controls that strips out TABLE-related tags for some time. The hacks work, but they’re hacks, and they have some quirky behavior.
I wrote a post on the ASP.Net forums, in which I described the problem.
I was glad to see that membership controls were added to the latest beta release. However, I did notice that all of them (with one exception) still put a TABLE wrapper around the content when using a templated control. It happens on the Login and PasswordRecovery controls…
Ironically, the CreateUserWizard did not add a table wrapper around the CreateUserWizardStep — but it did add . . .
→ Read More: CSS Adapters for Membership Controls (working versions)
Posted on June 29th, 2006%
While going through the ASP.Net forums, I stumbled across a post where a guy asked:
I’m having trouble coming up with a good solution for programmatically mapping members of a business object to control elements on our UI. I’m wondering if someone else has done something similar and might have some useful suggestions.
My reply was a rather lengthy one in which I talked about an approach I recently used in the rewrite of my online baseball game, CSFBL. Since I eventually wanted to blog about this stuff, I figured I’ll just copy/paste the post I made on the forums below…
I struggled with this a bit (struggled in the sense that I couldn’t come to agreement with myself on how to do it!)… the following is what I settled on.
All my business objects are created using CodeSmith templates for Paul Wilson’s O/R mapper. I wanted the web interface to be able to use these directly from both . . .
→ Read More: Mapping business objects to ASPX pages
Posted on April 18th, 2006%
About two months ago, I wrote a post about removing the TABLE from ASP.Net 2.0′s Login control. The below code will let you do the same from the CreateUserWizard control. One important caveat: for this to work (in my limited testing), you must provide a custom template for the ContentTemplate and CustomNavigationTemplate of the CreateUserWizardStep, and for the ContentTemplate of the CompleteWizardStep.
public class CssCreateUserWizard : System.Web.UI.WebControls.CreateUserWizard
{
protected override void Render( HtmlTextWriter writer )
{
if ( CreateUserStep.ContentTemplate != null && this.ActiveStep == this.CreateUserStep )
{
WebControl creatediv = new WebControl( HtmlTextWriterTag.Div );
creatediv.CssClass = this.CssClass;
CreateUserStep.ContentTemplate.InstantiateIn( creatediv );
. . .
→ Read More: Removing the TABLE from the CreateUserWizard control
Posted on March 17th, 2006%
While working on a client project, I needed some URL rewriting code. Effectively, I wanted to turn this:
/4/Page.aspx?
… into this:
/Page.aspx?id=4
Sure, I’ve done URL rewriting in the past using the Application_BeginRequest method, but I wanted something more modular, scalable, and powerful. What I found was http://urlrewriting.net/en/Default.aspx.That site offers a fantastic, free, open-source solution for ASP.Net 2.0 Web sites that need URL rewriting functionality. Implemented as an HTTP handler, it uses regular expressions for maximum power and flexibility, and it only takes a few minutes to integrate with your project. Highly recommended!
. . .
→ Read More: A URL rewriting library for ASP.Net 2.0
|
|