Scott Cate Weblog 

scott.cate@myKB.com
http://scottcate.myKB.com



Article InformationModified
ASP.NET DevConnection Samples
The Samples that I ran/demo'd in Orlando for the April 2008 DevConnections can be downloaded from the following zip file. http://www.ScottCate.com/Ajax2008.zip    (... more)
5/5/2008
Scott Cate Ajax Demo Code
If you've seen me present in a user group or VSLive or any other event, and the topic was on Microsoft ASP.NET Ajax extenstions, chances are you're looking for this code link :) http://www.scottcate.com/downloads/scottcateajax.zip    (... more)
11/5/2007
Steve Smith's Awesome Caching Pattern
My friend Steve Smith who wrote this article has solved a major problem for me. With his permission I'm duplicating some of his code here. About one in 50,000 page views, I was getting an "Object Not Set" exception being thrown in kbAlertz.com. This was a mystery for a very long time, and it's finally solved (Thanks Steve :). Here is ( IMHO ) how the typical developer retreives something from the cache in an ASP.NET application. PRE.ShowCode {BACKGROUND-COLOR:#ffffff;PADDING-RIGHT: (... more)
10/6/2007
The Honorable Ray Borane is awarded the 2007 "Cesar E. Chavez" award from the state of Arizona.
I had a great time this week with my best friend, Joey Borane. His father is the Mayor of Douglas Arizona. The Honorable Ray Borane was awarded the Cesar E. Chavez award from the State of Arizona. The session was opened by the Arizona Governor Janet Napolitano, she gave a nice introduction, that I was able to grab on video. Then a few others spoke, and Joey's father was brought up on stage. Thank you Joey for inviting me to this great event. I had a (... more)
4/6/2007
RaisedLaptop Pricing.
The laptop stands are currently out of stock Shipping Charges $6.00 for the first item. $2.00 for each additional item. $19.99 Each unit.   Laptop Stands Rasied Laptop Raise your Laptop Save your back Get your 10 Key back.  (... more)
6/9/2006
Raise Your Laptop, with our Laptop Stands! Lift it to Eye Level!
Is your back killing you? Lift your laptop or notebook up to eye level. This works really great for laptops when you're using an external mouse and keyboard, and an external monitor. Take a look at our pictures of the laptop stands, being raised to eye level, and to match the level of the flat panel monitor. Raise your laptop! Raising your laptop to eye level has a ton of great advantages. Using an external keyboard and mouse, will make you much faster and more productive with your (... more)
11/2/2005
Laptop Stands :: Pictures Page 2
100% Ebay Feedback Rating Money Back Guarantee Fast Shipping!!!  (... more)
10/25/2005
Laptop Stands :: Pictures Page 1
  Fast Shipping!!! Works with All Brands!!! 100% Ebay Feedback Rating Money Back Guarantee  (... more)
10/25/2005
The Famous Laptop Stands
Will ship within 1 business day. Buy through PayPal :: 19.99 This is a copy of a regular running ebay Auction. The price is the same, but this page is always available. Mouse Over Images to see Instant Larger Picture Fast Shipping!!! Works with All Brands!!! Buy through PayPal :: 19.99 Mouse Over Images to see Instant Larger Picture 100% Feedback Rating Money Back Guarantee Buy through PayPal :: 19.99 Mouse Over Images to (... more)
10/23/2005
We finally made Channel 9
PDC this year was a lot of fun. The weekend prior to PDC, we were able to have some fun sailing in the Pacific Ocean. While on deck, my friend Lorin Thwaits, whips out a video camera, and convinced me that the PDC ShowOff would be a quick and fun video to put together. So with a little improv, screen capture, and a few takes, this is the final result. http://channel9.msdn.com/Showpost.aspx?postid=121812 Richard Hundausen (Microsoft RD), is the background. It was a great (... more)
9/29/2005
Visual Studio Keyboard Shortcuts
My good friend Michael Palermo today showed me the best keyboard shortcut ever. In fact, this is to a feature I didn't even know existed. When in a code window for Visual Studio, you can go full screen, hiding all the other windows, tool bars, title bars, and even your start bar. This is the same effect that Internet Explorer has when it's in "Full Screen" mode. [SHIFT ]+ [ALT] + [ENTER] = Toggle Full Screen Mode I'm sure this works in all versions, but I haven't tested it, as I'm (... more)
6/14/2005
Looking for the new ConfigurationManager?
I was just spinning up a little console application, as a utility, and I'm pulling an encrypted connection string from the app.config file. Using 1.1 code that I'm used to, I used.... System.Configuration.ConfigurationSettings.AppSettings["connstr"].ToString(); And the compiler gave me the following error. Warning 1 'System.Configuration.ConfigurationSettings.AppSettings' is obsolete: 'This method is obsolete, it has been replaced by ConfigurationManager.AppSettings' So I (... more)
6/13/2005
Securing Trace.axd - Remote & Local
In the Arizona .NET User Group (http://www.AZDNUG.com) that I run we were talking about tracing and all the awesome features and abilities it has and we ran into a problem. You may know that if tracing is enabled and is not specifically flagged as LocalOnly="True" then you can access Trace.axd from anywhere. This can be very dangerous if your are Trace.Write(ing) things like Configuration/Connection Strings (which is a terrible idea) SQL Strings Variable Name/Value Pairs  (... more)
3/1/2005
Looking for System.Web.Ui.Design ?
I just inherited a project where one of the class files was "using System.Web.UI.Design;" My project did not compile of course, because I didn't have the assembly referenced. I had System.Web already referenced, so naturally I thought I'd add a reference to System.Web.UI and everything would be peachy. Right? Wrong. There is not a System.Web.UI.dll or System.Web.UI.Design.dll to reference. After 5 wasted minutes I found the namespace in System.Design.dll. So I decided to (... more)
2/2/2005
Announcement: 2005 MVP Award
Thank you to Microsoft for awarding my community efforts with another MVP award. My first MVP award came one year ago in January 2004. The award is given for community work done the year before. I'll continue to devote as much time as possible to ASP.NET with a goal of helping as many people as possible in 2005. Thank you Microsoft for the recognition, and thank you to all the people who've asked me for ASP.NET help, including all the members of my User Group ( http://www.AZGroups.com ) (... more)
1/4/2005
November 2004 -- AZGroups.com Tips/Tricks
For my user group ( www.AZGroups.com ) ( November 2004 Session ) I will be showing ASP.NET tips and tricks. The Parentheses give hints to the files in the project that contain the code samples. Session highlights will include ... Using String.Format() with Web.Config URL and Path Variables Advanced keyboard maneuvers inside the Visual Studio IDE Configuration: Get outside the Web.Config with better performance ( /Config/ShowConfig.aspx ) Caching Patterns to Guarantee Object (... more)
11/17/2004
Retrieving File and Request Path Information
It seems to be a very common practice to check the URL and File paths. Many, Many scenarios require this information, and it seems that a lot of native classes are commonly overlooked. To bring awareness to classes that you may or may not know exist, I've thrown together a little table that shows several ways to get path information. Syntax to Request Path Information Result Request.ApplicationPath /MyWebSite Request.CurrentExecutionFilePath /MyWebSite/Paths/Paths.aspx  (... more)
11/15/2004
Poor Bird. You thought you were having a bad day?
Ever see a bid hit the windshield of a car? How about stuck in a store, airport, hotel lobby, or other public place? How about a plate glass window? My friend J. lives on the second floor, and has a wall of windows. Each plate glass window is about 14 feet tall, and brings a nice view of the city. It's easy for us to see out, but unfortunately it's not so easy for the bird to see. This poor bird actually left an impression in the dust on the outside of the glass, and I was able to (... more)
11/14/2004
2004 Nov 08 -- Fun Fact: How To tell if glass is dual pane glass
myKB.com has recently moved into new office space in Scottsdale, Arizona. The building we've moved into is newly constructed and is pretty fancy looking with an all glass exterior. Our entire office is frame with external windows, needless to say we have a lot of light. Anyway, to the fun fact. Due to the building shifting and settling, one of the huge sheets of glass has cracked. being lazy, and not wanting to walk outside the question was asked. "I wonder if it's dual pain safety (... more)
11/8/2004
My Big Ride at the Arizona State Fair
Once a year the Arizona State Fair comes to town. This year I was able to get some ride passes from a friend of mine who works at the fair. I just happened to be recording some movies and these two came out pretty good. You must watch them in order for them to make sense. The first movie, is a quick movie of the ride it self, while we were standing in line. http://www.scottcate.com/Downloads/Fair/TheRide.avi The second movie is a recording of the acutal (... more)
10/31/2004
Web.Config + string.format() Trick
One of the most common questions about the web.config file is... Is it secure? Well it's as secure as you make it. Anyone with access to the file system, probably has access to the web.config file. So here's a little obfuscation trick. Move some of your sensitive data out of the web.config, or pull it form different parts of the web.config with string.format(). Consider the following web.config entry. more)
8/1/2004
Find and parse hyperlinks in string
[^"]+[.\s]*)["']>(? [^ Isn't she a beauty? This is my first ever regular expression, that I actually come up with on my own. I did have help from Eric Gunnerson's "Regular Expression Workbench", but I still take credit for coming up with the regular expression on my own. So I feed in an HTML string, and this Regex.Matches returns a MatchCollection that I can cycle through. Each Match has a groups collection that looks something like this.  (... more)
6/18/2004
HttpModule that acts as a SSL Switcher
If you're working with SSL and ASP.NET, you know it's a challenge to be able to know when to switch back and forth between HTTP and HTTPS calls. I've thrown together a little HttpModule that inpects requests, and matches them to settings in web.config custom sections. There are files and paths sections. There are a ton of ways to do this, but I wanted a way to add this to projects that are already in existence, and an HttpModule seems to be the best bet. Basically you can add this (... more)
4/28/2004
Scott Watermasysk's HTML Friendly Code Viewer
If you've ever wondered how the color coded C Sharp Code files get displayed in my web pages. Scott Watermasysk's ShowCode.aspx page gives you the ability to paste in a code snippet. The page on post back will then format your code, optionally add line numbers, and give you back a great HTML string that looks beautiful. The link is below. The article reference are invaluable if you're showing code online. Thanks Scott !!!!  (... more)
4/2/2004
Using and Understanding BitWise Operations
Bitwise Operations are extremely fast, accurate, and amazingly useful. Unfortunately the term "bitwise" is not mainstream, and therefor seems to have an intimidating connotation. Remember the old days, when you had a 9600 Baud modem, and you had control over certain options by flipping "Dip Switches" on the back of the modem? You may have not known it, but you were using bitwise security. To understand Bitwise operations, you must know we'll be comparing bits. So first, What's a (... more)
4/2/2004
HttpContext.Cache Viewer (With DataSet Support)
Aw, the HttpContext.Cache. Most of the items I place in the Cache are named with GUID's so it's not very helpful to loop through and print out the Cache Item Name. I've built this handy ASPX page that gives a nice little view of the Cache in human readable form. All the Datasets, are displayed, including the DataTables. now keep in mind, that I'm not worried about the graphic design, or the looks here, I just wanted to make something work. I did add a little javascript to expand/collapse the (... more)
2/5/2004
New Photo Album Application
I just treated myself to a new digital camera. I've been wanting this camera since I saw it over a year ago. A friend of mine took my picture with this credit card sized camera, and I was in love with it ever since. My goal was to have a camera I could carry around, and not look like a tourist, so the number one objective was size. The Casio Exilim 3.2 S2 is perfect for my needs. It's external memory uses Secure Digital cards, which are also in use on my pocket PC phone, and my laptop, the (... more)
1/31/2004
[WINDOWS KEY] - More then just the start menu
The [WINDOWS KEY] usually found on your keyboard on either side of the space bar, or possibly on the outside of the [ALT] keys by pace-bar. If you don't have a [WINDOWS KEY] then this article can't help you, other then to have a general knowledge of the actions, but it seems to me that people are usually keyboard or mouse driven people, and if you don't use these commands on a regular basis, then you'll forget and never use them. Most people use this key as a single keystroke to activate (... more)
1/22/2004
Microsoft says thanks with an MVP Award for 2004
Wew huuuu .... is that how you spell excitement? Microsoft has handed me it's most distinguished award for my contributions to the ASP.net and .Net communities with an MVP award. This is most likely because of the success of the Arizona .NET User Group that I run, my Board Member position with ASPInsiders.com, and the community site kbAlertz.com. Official text below. Hi Scott, I would like to thank you for your community participation for the past year.   You have done (... more)
1/20/2004
Undocumented SQL 2003 Encryption Routines
My good friend Brady Gaster, once again, comes through with the best tip of today. A SQL guru he works with tipped him to this and he shared with me (just so proper credit gets served). Really pretty simple actually. Paste this into Query Analyzer. select pwdencrypt('Scott Cate') select pwdcompare('Scott Cate',pwdencrypt('Scott Cate') I found this article online about a buffer overrun error, but it's pretty old and seems to have been fixed with SP3. They claimed a buffer (... more)
11/30/2003
ASPInsiders
I currently hold a board member position with www.ASPInsiders.com. I would like to address several commonly asked question, and give my opinion/answer to them, and what better place, then in my weblogs? Who are ASPInsiders? ASPInsiders are members of the community that have been nominated by their peers. Once a single nominee received a certain number of nominations, they are then voted into general membership by the ASPInsiders Board - the board is elected by the members. No one person (... more)
11/26/2003
Another Great Use of Reflection
I found this on Brady Gaster post, and it is a great article on reflection by Nick Harrison. Basically he creates a couple of attributes to mark up your code for change requests, and requirements tracking. The article shows both C# and VB.Net code, and is 100% complete. Then in the end of the article he builds a windows application with a tree view component that parse the code, builds a tree of all the data found in the attributes. All the code is included in the article, and is very (... more)
11/25/2003
www.ASP.net
Microsoft has a dedicated website to ASP.NET development. It's full of articles and support issues. Probably the most helpful support area is asp.net/Forums where literally thousands of people are available to help you and answer questions. (... more)
11/16/2003
MSDN Specific to ASP.NET
MSDN on Microsoft.com has a great recourse dedicated to ASP.NET. They also have an RSS feed that spits out the most recently updated articles. This is a great way for me to stay up to date with ASP.NET Articles.  (... more)
11/16/2003
Google DeskBar with Keyboard Shortcuts
Google now has a DeskBar that you can use to activate Google from your keyboard. Here's how it works. After installation, you have to right click on the start bar, cruise up the context menu to Toolbars, and then turn on the "Google DeskBar". This will activate a toolbar that you can leave in your start menu, or if your toolbars aren't locked, you can actually drag off of your start bar, and dock it to any side window. The default keyboard shortcut is CTRL+SHIFT+G which puts your (... more)
11/15/2003
Reflection Data Access Layer
Reflection is an interesting topic. Code describing itself? Code looking at and examining other code? Well that pretty much describes what reflection is. First of I have to give thanks to my good friend Brady Gaster for turning me on to reflection. In fact what I've implemented here is actually his idea, and I've just gone a bit farther with it, then what he originally showed me. So what is reflection? Lets take a look at intellisense for just a second. How in the world is Visual Studio (... more)
11/15/2003
E-mail Support Groups - ASPAdvice.asp
ASPAdvice.com is a community site that runs e-mail lists dedicated to supporting ASP.NET. Each of these lists have members subscribed from around the world, and are full of helpful advice. Subscribing and unsubscribing from lists, is made very simple through a nice control panel on the site. If you're an ASP.NET programmer, you need to be on these lists. My only word of caution is that these lists are adicting. They're a great way to learn, becasue when people ask question, you get (... more)
11/8/2003
Cycle through the Clipboard Ring
When you copy a block of text in Visual Studio (CTRL+C), you may not know that the text is placed on a "Clipboard Ring". So when you copy another text block, the first text block isn't removed, it's just moved down in the queue, on the Clipboard Ring. You can see the Clipboard Ring as a section in the Toolbox. You'll see an entry for each pasted item. You can click these with your mouse, and the item will be inserted at your current cursor position. Normally you would CTRL-V to (... more)
11/8/2003
Jump to Matching { } in Visual Studio
1: If(thisObject.ToString() != null) 2: {          ..... 3: } If your cursor is positioned before or after the open or closing block (lines 2 or 3) CTRL+} will jump your cursor to the other { } character. If your hold the shift key down, you'll effectively highlight the whole block. This is a great keystroke to move large blocks. I particularly use this when I've decided to create a Try Catch statement, and need to move large blocks of code.  (... more)
11/8/2003
Block Selecting for Cut/Copy/Paste Operations
I used this today and realized it's a nice little time saving feature. Block Selecting is the ability to highlight text in multiple rows by column, not the entire row. Here's where I used it. I found in my code that I created a New Sytem.Text.Stringbuilder and then had about 15 .Append("") Commands. So the code looked something like this. Dim sbMessage as New (... more)
11/8/2003
Online ViewState Parser and ViewState Encryption
Ever wonder what the gobbly-gook in your viewstate is? Do you think your view state is safe? Unless you're encrypting your viewstate, it's open for the world to dissect. Try this. Create an aspx page, add something to the view state, browse to it, and view the source. Look for the tag, and copy everything in between the value="" quote marks. The browse to WilsonDotNet.com/Demos/ViewState.aspx (link below) and paste it in. Click the "P (... more)
11/7/2003
Most important announcement this year; "Colors in the Console"
This is something I’ve never thought about, but it sure is nice. It’s the simple things in life that make programmers happy. Console.Writeline now supports color.  (... more)
10/27/2003
Don’t use Try Catch for Flow Process
In 1.1 and 1.0 under certain circumstances you were forced to use Try-Catch blocks to control flow in your code. Because the only way you can know if the method is going to fail, is to run the method. Try { DateTime.Parse(“mm/dd/yyyy”); } Catch (FormatException ex) { Console.Writeline(“Invalid Date”); } In 1.1 one the double has a method called Double.TryParse, which does not cause an exception. In 2.0 this TryParse has been extended to all Value Types. Double.TryParse in 1.1, (... more)
10/27/2003
C# Generics, Introduction Article By Robert Chartier.
This is a great introduction to C# Generics By Robert Chartier http://www.15seconds.com/issue/031024.htm When we look at the term "generic", unrelated to the programming world, it simply means something that is not tied to any sort of brand name. For example, if we purchase some generic dish soap, soap that has no brand name on it, we know that we are buying dish soap and expect it to help us clean our dishes, but we really don't know what exact brand (if any) will be inside t (... more)
10/27/2003
More about the PASSLINE bets
The PASSLINE really is the lifeline of the game of craps. When you stand at the craps table, you are actually playing many, many, many games of craps. The PASSLINE is easier to understand once you understand, it's what starts and ends the game. The idea of the passline, is to roll a POINT NUMBER on the COME OUT that is 4,5,6,8,9,10. If one of these numbers is rolled, then the games is ON. Now you can either win, or loose, based on the POINT NUMBER. If you roll the POINT NUMBER again (... more)
2/4/2003
Assignments, A little different
  VB.NET C# = (A=B) Either Assignment or Checking Value of A is Equal to B == Checking Value of A Is Equal to B A=A+1, A=A-1 A++ , A-- <> != OR || AND && These are not complete, but give a pretty good idea. (... more)
2/3/2003
Begin XXX, End XXX = {} Blocks
VB.NET If X=Y Then End If C# If ( X==Y ) { } Basically the same, but a lot less typing. (... more)
2/3/2003
Declaring Variables
VB.NET Dim Variable as Type = Default Dim i as Integer = 0 C# Type Variable = Default; Int i = 0; Basically the same, but a lot less typing. (... more)
2/3/2003
Case sEnsaTive
The first thing I know I'm going to have problems with is the C# case sensativity. Fornunately, Visual Studio.NET is helping a lot. Basically eveything is case sensative, which I'm ok with for my own variables, but I've been super lazy with VB.NET working with the .NET classes. Now I can't be lazy. (... more)
2/3/2003
Adding Header Row to a Datagrid
This seems to be a common question and I had to deal with it just yesterday. After a little while I found the solution and thought I'd share it. It's a great trick to add a header description, or a toolbar control, or whatever you need at the top of your datagrid. It could just as easily be used as a footer trick. The trick here is knowing that DataGridItem is actually a row in the DataGrid. Once I found this object, it was all downhill. So we create a row (DataGridItem), then create a cell, (... more)
12/23/2002
My Favorite Spell Checker for Internet Explorer
http://www.ieSpell.com has a great spell checker that I use by the hour, daily. The program is free for personal use, but the software provider does ask for "donations" to support the product. If you are using this is a work environment, it's not personal. Cough up some cash for the company, it's a great product, that is only a few seconds to download and once you start using it, it'll immediately become a part of your everyday life. I recommend a $20 Donation if you end up using this (... more)
10/2/2002
A Work Around to "session state expired"
I had written an application for one of my users that implemented writing a very large document. This document was created on-line using on of my favorite .NET Components from www.RichTextBox.com. So to publish these documents, my user would sit on-line and type into this rich text box environment, which was fine except that when she was editing a document, I had stored the data row from the database in a dataset that was sitting in the user session, that most of you know only exists for 20 (... more)
10/2/2002
Don't type http://www. and the .com
When you're in the address bar of Internet Explorer you can type the base domain and then press [CTRL] + [ENTER]. This will automatically precede the domain that you've type in with http://www. and then add .com as a suffix. It obviously doesn't work for .org or .gov, but 99% of the sites you visit are .com so this will really help.  (... more)
9/26/2002
How the casino always wins - My Version
Here is something that most people don't realize. When you are gambling and you bet, if you loose your bet, you loose and if you win your bet, you still loose. I know some of you are thinking I'm crazy but hang with me for a second and you'll see what I'm talking about. Take roulette. Betting $5.00 on Red. If it comes up red you win $5.00 and if it comes up black, you loose $5.00 - So everything is even right. WRONG! You remember that there are 2 green numbers  (... more)
9/26/2002
Groups.Google.Com
Google.com is (as most of us know) an extremely valuable search engine. Groups.Google.Com will change your life. It is the worlds best resource to find answers to questions that other people have already asked and then answered. Like most searches, the more specific you are, the better your search results are going to be. I will turn to this resource before a book to reference syntax on coding, or to find a function that someone else has written and shared. Thi (... more)
9/26/2002
Here's What I'm Thinking.....
99% of data access that I create for my customers is done for 1 simple reason. Give the customer access to a table of data. To do this, obviously you need to accomplish a few things with the form. A Data Display List, usually a datagrid An Edit button, to start the edit process An Edit Form, to actually do the edit Save/Cancel Buttons to Save/Cancel the Changes And a create form that mimics the Edit Form, but with Insert actions instead o (... more)
9/25/2002
Knowledge Base Software - myKB.com

 

Cameron Cate Pictures
Cameron Cate Pix

Site Navigation

Home
Knowledge Base
Wiki Discussions
Photo Album

Sites I Own & Run


Easy Search ASP.NET
mykb.com knowledge base software logo
myKB.com
Knowledgebase Software

KBAlertz.com
Arizona .NET user Group
Group Leader

Affiliations


ASP.NET MVP
2004
2005
2006
2007


Blog Sites I Read

Brady Gaster
Rob Howard
G. Andrew  Duthie
Robert McLaws
Alex Lowe

World of Scott.Net

Scott Guthrie
  -  Father of ASP.NET

Scott Watermasyk
  - .Text (Weblog)

Scott Sargent
Scott Mitchell
ScottG.net
Scott Bellware
Scott Forsyth
Scott Hanselman
Scott Cate

Favorite Books


ASP.NET Cookbook


First Looks @ ASP.NET 2.0