For those of you who don’t know, those sweet validators we use in WebForms are not available in Windows Forms. Greg Duncan has a post today that shows how to use an ExtenderProvider to create a RegEx validator in the same vein as the web one. MVP Billy Hollis had a similar article in 2003, and shows how to create several validators. For the time-pinched, you can find a current version of the sample at http://dotnetmasters.com/samples.htm.
Month: July 2005
“How do you know how big to make a field in Crystal Reports?”
Laying out a Crystal Report can be stressful, especially when you’re guessing at how wide to make a field so string data fits. The problem is, string database fields (such as nvarchar) are measured in characters, but text felds are measured in inches or centimeters. You could guess at the field width, run the report, see if everything fits, and keep adjusting and running until the entire database field fits the field on your report.
Or you can be smart.
Open your database (or database schema, whatever you are using), and see the maximum length of the data field. Let’s say we have a varchar(50). We know the maximum number of characters is 50. On your report, add a Text Object, and make it kind of wide. Type in 50 M’s (like this: MMMMMMMMMM…). Resize the text object until all the M’s are visible. Drag the database field onto your report, and make it the same width as the 50 M text object. That is the maximum width your database field will be.
In proportional fonts (such as Times New Roman or Verdana), the uppercase M is typically the widest letter (in monospaced fonts like Courier New, all the letters are the same width). Using the letter M is an old typesetter trick, and carries over into today’s world. If you have ever used CSS, and set a font size to ‘1 em’, the ’em’ unit is equivalent to the width of the M in that font face (this is different than the <EM> tag, which italicizes the text). The ’em’ unit does not have a definite width (such as a cm or in), but is a relative width in each font based on that font’s specification.
Scotty is Beamed Up
Sad day in Geek-land:
LOS ANGELES – James Doohan, the burly chief engineer of the Starship Enterprise in the original “Star Trek” TV series and movies who responded to the command “Beam me up, Scotty,” died Wednesday. He was 85.
OT: If You Really Loved Me, You Wouldn’t Have Sent That To Me
Dear Parent-Spammers, Sibling-Spammers, Friend-Spammers, etc.,
If you really loved me, you wouldn’t have every e-mail message on auto-forward. Instead, you’d evaluate the content of the message, maybe check out its claims, and discard the crap. To wit:
- There is no spider lurking under toilet seats that will bite your rump.
- That isn’t a computer from 1954. It’s an entry in a Photoshop contest.
- Mars was closest to Earth in 2003. That was two years ago.
- Starbucks says they love our troops too, and I need caffeine, so I’m still stopping there.
- Everyone’s kidneys are safe.
You can check any of these out at www.snopes.com. Please do so.
- I know it says it’s from your bank, but it’s not from your bank. Trust me, delete it.
- Don’t open the screensaver. Ever.
- Microsoft does not send updates via e-mail. Never have.
- If I don’t personally deliver it on a CD, you shouldn’t install it. If you do install it, and weird stuff starts happening in the middle of the night, don’t call me. I’ll hang up on you. You have been forewarned.
- You are far from the first person to send that to me.
- I have two dogs. They are cute. I do not need any more photos of cute dogs, especially ones whom I do not even know. I especially do not need several megabytes of photos and/or video in a single e-mail message.
- No one from any third world country has any amount of money for you.
- You can’t get off their mailing list, and asking them to take you off only makes it worse.
- You, and 50 million others, have been specially selected only because they have your e-mail address. It’s not real, just delete it.
So please, before you mash that Forward button, think about what you’re about to do.
DotNetNuke Error “System.Security.Cryptography.CryptographicException: Bad Data.”
If you receive a Bad Data error when working with DotNetNuke, the problem seems to be with cookies. The solution is to clear the cookies from your computer, and that should take care of the problem. It worked for me when I encountered the error. There is a discussion on this at http://forums.asp.net/975037/ShowPost.aspx, and one of the core team members has a code workaround.
After I cleared my cookies, I changed the name of the FormsAuthentication cookie in my web.config, and the problem has not happened again.
I run DotNetNuke in my main directory (www.rjdudley.com), and have dasBlog set up as a separate application in a subdirectory (www.rjdudley.com/blog). This error arose after I had logged into my blog site and edited posts or other admin functions, and then tried to log into my DNN portal. If I manually removed the single cookie for my site from my cookies folder, I could log in with no problems.
Even when I tried setting the path attribute of my forms tag in the web.config for dasBlog, I still got this error.
A Few Clarifications For Mike Drips
Leaving the easy ones aside, here’s a few things Mike Drips might want to know before he writes another article:
Serious developers know there is more documentation available than just MSDN Library (while we’re on the subject, MSDN Library is head, shoulders, sternum and probably naval above what Netscape and Sun provide for online knowledge). There’s these things called ‘books’, you see, and you can buy them fairly cheaply. They are full of really good information. If you insist on downloading something for free, MS provides a complete JScript reference in its Windows Script Documentation. You’ll find the latest version at http://www.microsoft.com/downloads/details.aspx?FamilyId=01592C48-207D-4BE1-8A76-1C4099D7BBB9&displaylang=en. This download also includes a VBScript reference.
In response to
All I can say is “OMG! To program a website, you have to know how to program a website!” Guess what–if you wanted to program for another platform, you’d still need to know HTML, CSS, XML, Apache and probably PHP and DreamWeaver. BTW – You forgot FrontPage 2003, which is the recommended editor for SharePoint pages, and SQL Server 2000. You only need VS if you want to build web parts.
Exactly how ‘alien’ should a technology be that has been around since 1995? Hello?
2) The next release of SharePoint isn’t timed for Longhorn, it’s timed with Office Wave 12, which is scheduled for late 2006. SharePoint doesn’t rely on Windows APIs now (the WSS are extensions to the web server, not a native API), so the next OS release is irrelevant. SPS v3 will run on Win2K3 servers.
3) WSS is not a subset of SPS. SPS is a superset of technologies that adds functionality on top of WSS. MS does clear this up at http://www.microsoft.com/sharepoint/overview.mspx#EDAA:
SharePoint Portal Server 2003 is a secure, scalable, enterprise portal server built upon Windows SharePoint Services that you can use to aggregate SharePoint sites, information, and applications in your organization into a single, easy-to-use portal. SharePoint Portal Server 2003 relies on Windows SharePoint Services to provide basic Web hosting and document storage functions, but extends it with additional functions for navigation, search, application integration, and personalization.
This particular page might be more recent than Mike’s SP experience, but that explanation has been around for a long while.
4) You didn’t start with the “Microsoft SharePoint Products and Technologies Resource Kit”, did you? I guess if you don’t know how to program a website, then yeah, a lot of the SP books will be useless. That web programming thing might have been something to look into before diving into a SP installation.
5) MS laid out a very solid plan for SharePoint in April at their strategy briefings for CIOs. It was good.
Very Sweet Open Source DNN Calendar Module
I stumbled across a really sweet calendar module for DotNetNuke today–the AVCalendar from avanced.net. It’s open source/donationware, and is the best DNN calendar module I’ve found yet. It supports multiple calendars, which you can arrange as master/child, and an additional calendar list module that lists events from one calendar. It handles recurring events, and events with limited enrollment. You can also set a charge for enrollment, and use PayPal for admission. Weekly and Monthly, as well as etailved views, and there’s an option to add the calendar event to a VCS-compatible calender app such as Outlook. Definately worth a look. I’ll be adding this to the BADNUG site shortly as we plan our next events.
Preventing Page Review after Logout with Forms Authentication
My latest ASP Alliance article has been published today:
Preventing Page Review after Logout with Forms Authentication
The inclusion of Forms Authentication in the .NET Framework has been a significant benefit to developers securing web-based applications. While pages can be secured server-side, local caching by browsers and proxy servers may allow a user to review information even after they have logged out. In some cases, this may present a risk to the user’s confidential information. This article discusses three HTTP headers that can be used to prevent local caching of web pages, adding some protection to the user’s data.
Read more: http://aspalliance.com/694
Review: Professional DotNetNuke ASP.NET Portals
My latest ASP Alliance article has been published: Review: Professional DotNetNuke ASP.NET Portals
DotNetNuke is an exciting open-source portal application, full of features and potential. Unlocking the application’s potential through custom modules and configurable skins can involve a steep learning curve. “Professional DotNetNuke ASP.NET Portals” has been written by members of the DotNetNuke Core Team (which manages the overall project), and provides an in-depth discussion on what a developer needs to know to install and develop for the portal.
Read the full review at http://aspalliance.com/693.
No Excuses To Be An Idiot Now…
|Your IQ Is 115|
Your Verbal Intelligence is Genius
Your Mathematical Intelligence is Above Average
Your General Knowledge is Exceptional