Tagged with ASP.NET
TheServerSide.NET has finally put up the source code to my article. If you need a searchable Profile Provider for ASP.NET 2.0...check it out.
There are several blogs that have discussed how to share an auth cookie between sites in a farm and how to do a true single-signon for a domain. Mark Brooks pointed me to these that help a lot:
Now the trick is to do it between a 1.x and a 2.0 site in the same environment (but in different IIS Applications). The trick is to create a <machineKey /> entry in both web.configs. Pete Bromberg has a nifty little web page that will help you generate one to use for both:
The only thing left to do (and this is the magic really) is change the <machineKey /> on the 2.0 site to add a decryption attribute. This is a new attribute that is only supported on 2.0. You need to specify the decryption attribute because the decryption method changed between 1.x and 2.0. So for your 1.x site, the <machineKey /> would look like so (not my real machine key):
I've been working on some ASP.NET 2.0 code for the last few weeks and ran into a bug that (in my opinion) is particularly nasty. If you are comfortable with the 1.x model at all, you're likely to run into it. In the 1.x model, all code-behind classes were compiled into a single assembly. So you could:
MyCodeBehindClass ctrl = (MyCodeBehindClass) LoadControl("...");
I find it unfortunatle that Microsoft has made is way too difficult to write your own DataSource enabled controls. Deriving from DataBoundControl, but it still does not seem to be a way to synchronously get the data from the DataSource. In a DataBoundControl control you can get the DataSourceView like so:
DataSourceView view = this.GetData();
Back in the day when ASP.NET shipped, I converted this site from the existing ASP based site. As an exercise to really bring in some new features I've wanted and to lose the ASP legacy (I actually still have a page or two that uses string concatenation to put together HTML Tables), I want to do a full re-write of the site.
I use a process where I begin with the requirements, then the data, then the code (no big surprises there). My goal is to blog through each stage of this process and hopefully help my readers learn a bit about an ASP.NET 1.x to ASP.NET 2.0 conversion.
Look for rants about this process starting as early as today!
This new property (*not* event), allows you to wire up clientside code to be executed before the server-side onclick is handled. In the old days we had to do this manually. For example, this is how you would hook up a simple confirmation dialog:
This allows you to cancel the server-side event if the user says nope! Cool!
This probably isn't entirely correct since I am just looking at the output (e.g. the database rows) to determine this. For each object in profile (i.e. Users), there is a single row in the aspnet_Profile table. This table is made up like so:
The three middle columns are used to store the properties and their values. PropertyNames stores a list of properties with hints on how to retrieve it from the String or Binary column. For example:
Each section of this string is the metadata about the property:
I am working on a portal project with ASP.NET 2.0 and I am loving it. Lots of stuff is in the box that I need. The project is using VB.NET so I wanted to make sure that everything was Option Explcit On and Option Strict On...but since it is a Web Application, the normal property pages are nowhere to be found (unless I am missing it). If I create any other project type (I think), I can look at the project property pages and see the Compile tab:
Why are web apps treated so differently these days? Can anyone explain how I missed this?
I've been digging deep in to ASP.NET 2.0 the last couple weeks and I have been pleasantly surprised by a number of nice changes that probably didn't make the new features lists:
In addition, I was surprised by the intuitive forms authentication controls. I was using the PasswordReminder control and wanted to capture the reminder and change the password to reset the password instead of remind them of their password since we were just storing the hashes. But after digging in deep, I found out that since I setup the personalization to store as hashes, it was resetting the password.
Of particular interest is the DataSetDataSource object which is being postponed. Though you can use the ObjectDataSource to bind to a Typed DataSet so it's not that much of a death-knell. Check it out...
I just wanted to give a shout out to Andy Smith of MetaBuilders ASP.NET controls. I regularly use his DialogWindow and FirstFocus controls. He has a number of controls on his site that are just great, but I can only speak for those two. My $0.02 review of them are:
Great work Andy!
I hear from a lot of readers that they are creating 3-tier ASP.NET apps and I always wonder if they know where the middle tier is.
In my opinion, the web server is the middle tier and client tier is the browser. Creating another set of machines to host the data layer isn't really necessary and, in fact, hosting the data layer on the web server is easier to scale. We know how to scale out web servers. Inventing a new set of machines forces you to figure out how to scale them out and it does not increase your scalability by scaling out both the web server and a fourth tier.
If you disagree, please e-mail me and let me know what you think.