Rants Tagged with “ASP.NET”

<<  <  1  2  3  4  >  >>  (Total Pages: 4/Total Results: 39)

New ASP.NET 2.0 Version of The ADO Guy

Welcome to the new version of The ADO Guy.  Most of the changes are under the covers, but there are a few things to note:

  • No more collapsable sections (some of you didn't like them and I agreed).
  • Registration is now required to ask questions.  I've gotten a lot of abuse from my open way to submit questions.  I am sorry to have to resort to this, but I am hoping this will help the process not hurt it.  User information will only be used for questions and communication about them.
  • Some visual changes, but not many.

Please let me know what you like and don't like.  A couple of things aren't working yet:

  • Searching quesitons is disabled for now.  It'll return soon.
  • The Book Owners area is disabled.  This will return very very soon.

 UPDATE: Comments aren't working...Yet.

Custom Profile Provider Code Up at TheServerSide.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.

How to share Forms Authentication between a 1.x Site and a 2.0 Site in the Same Domain

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):

<machineKey validationKey='301B0898AB6288CA285641FC1DAB5653B8EC18E212A05FC20AA775383EEBF84428FD68BBD09E4FAE8E921A30E69F443D320541EEF272B322FA819035333E712C'   
            decryptionKey='096C74A8F465A5CFD629CAB61D9DD77651957F100406124F'
            validation='SHA1'/>

But for the 2.0 site you just need to add the decryption attribute and specify 3DES (which was the 1.x default):

<machineKey validationKey='301B0898AB6288CA285641FC1DAB5653B8EC18E212A05FC20AA775383EEBF84428FD68BBD09E4FAE8E921A30E69F443D320541EEF272B322FA819035333E712C'   
            decryptionKey='096C74A8F465A5CFD629CAB61D9DD77651957F100406124F'
            validation='SHA1' decryption='3DES'/>

New Article: "Creating a Custom ASP.NET Profile Provider"

My first article for The Server Side .NET.  It covers how to write your own Profile provider and includes a sample provider that allows simple searching.  Hope you enjoy!

Compile ASP.NET 2.0 Site to One Assembly!

Scott Guthrie has new this response on the asp.net forums to the issue of each page compiling to its own assembly (which has a number of issues that I won't belabor here).  He announces that when VS 2005 is released, there will a tool that can be used in build scripts (but not debugging I'd guess) to merge all your assemblies into one large assembly.  One file deployment of a website?  Yeah!

Nasty ASP.NET 2.0 Bug...Postponed?

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("...");

In the 2.0 model, each page/control is compiled into its own assembly!  so your LoadControl doesn't know about unless you move the codebehind into a further class in the AppCode section of your website. 

Here's a response from MS in the ASP.NET forums:   http://forums.asp.net/928782/ShowPost.aspx#928782.  Also, the URL link above is the actually lady bug that they've marked as Postponed!

This seems like such a hack and is making me wish more and more for a 1.x compatibility mode.  I know of several users who are running into this with migrated projects, but it happens in 2.0 projects all the time (and the errors produced are not helpful in figuring out what went wrong).

So ASP.NET team, please tell us why this is a better model?  Please don't tell me its because you wanted to appease the ASP people in letting them drop new aspx files into fileshares.  While this is laudable, it should not be the default behavior.  It makes no sense in most large-scale web projects. 

Problems Creating Custom DataSource Enabled Controls in ASP.NET 2.0

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();

Great!  Except that to actually get the code from the view requires you call view.Select() which is asynchronous.  Luckily for Microsoft, their controls use a friend/internal method called ExecuteSelect().  If you look into the code that the GridView, FormView and DetailsView use, they don't call it asynchronously, but you have to ;)

There was a LadyBug filed...but was marked as "We're not taking new suggestions for Whidbey any more". 

That leaves the control designer with two options, call it asynchronously or use reflection hackery to call ExecuteSelect.  ARG!

Rewriting ADOGuy.com: Part 1 - Requirements

For the new wildermuth.com, I have the following requirements:

  1. Keep ease of use to find my blog, rants and questions
  2. Add registration to eliminate the amount of spurious quesitons I have submitted to me.
  3. Allow registered users to personalize the site.
  4. Simplify searching for questions and rants into single point of search.
  5. Enhance maintenance pages to allow someone but me to maintain the site as needed.
  6. Keep all old URL's working even as I change the structure of the site.
  7. Eliminate my home-grown "MasterPages" solution and use the newly built one.
  8. Allow users to answer questions, submit code snippets, add book reviews, etc.
  9. More easily support more than one syndication model (RSS, Atom, etc.)
  10. Keep performance of site same or better than existing site.
  11. Improve data integrity by moving to a better backed-up data store.
  12. Include a "client" area to allow my clients to better use the site as a communications medium.
  13. Improve the "Book Owners" area to make it easier for owners of my book (or forthcoming books and articles) to get sample code and electronic copies of the books/articles.

I am sure there  are more, but those are the core of the new requirements.  Tune in tomorrow to start matching requirements with solutions...

 

Re-writing ADOGuy.com for ASP.NET 2.0

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!

Master-Detail in ASP.NET 2.0 is Pretty Cool

I have been struggling and playing with RAD'ing some quick and dirty pages for the ASP.NET 2.0 conversion of this site.  They are Admin pages so they aren't hit often.  Quick and dirty seemed to be the perfect solution.  I did run into some speed bumps, but now that I understand what they wanted from me, they are working great!  I am a big fan of the GridView/FormView/DetailsView controls.  Check them out if you get a chance.