Geeks With Blogs

News
Welcome to my blog.
Here's what we've got on the menu today:

Lorin Thwaits A geek says what? ASP.NET
Interesting Type difference in .NET 4.0 when using DataBinding

Consider this common construct that you and I have thrown into ASPX pages for years now:

<%# DataBinder.Eval (Container.DataItem, "EmployeeID") %>

In .NET 3.5.1 and older it returns -- tada -- a string.  No mystery there.  But in .NET 4.0 it returns the same type as the underlying data type -- which in this case for me was a nullable int.  Interesting, no?

Posted On Sunday, March 21, 2010 7:39 PM

.NET Framework 4.0 mysteriously loses track of System.EnterpriseServices
The GAC in .NET 4.0 is cut into two parts now -- one half for .NET Framework 2.0 stuff, and the other for v4.0 stuff. When compiling any project, targeting .NET 2.0, 3.5, or what have you, this annoying error may pop up: Could not load file or assembly 'System.EnterpriseServices, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d5... or one of its dependencies. The system cannot find the file specified. If you are working on a 32-bit system then open a run box and perform this copy command: ......

Posted On Sunday, March 21, 2010 7:12 AM

Scott Guthrie's visit to Phoenix is tomorrow
Can't believe how fast the time has flown leading up to this big event. I've been so busy with all the details of getting a huge screen rented, insurance lined up, advertising in place, and more. What a blitz. We were lucky to be able to rent a really nice theater in Arizona, Symphony Hall in the downtown. Now it's just about showtime. If you're in the area and haven't signed up for the event yet then take a look: http://azgroups.com/uber07 It's worth taking a sick day at work to come and join in ......

Posted On Tuesday, June 26, 2007 9:34 AM

Awesome one-day Silverlight event with Scott Guthrie
Learn Silverlight from ScottGu himself! Did you miss MIX? You're in luck. AZGroups has one big "Uber" meeting a year, and this year will feature Scott Guthrie and Stefan Schackow digging deep into the latest technology being released by Microsoft, including Silverlight. It will be held on Wednesday, June 27th from 8am to 4:30pm at Symphony Hall in downtown Phoenix. It's a free event open to the public, and you can sign up here: http://azgroups.com/uber07 Attending Uber '07 will be time well spent ......

Posted On Thursday, June 14, 2007 12:38 PM

Microsoft brought FPSE back. Will VS2003 work in Vista now?
Some Sharepoint and Front Page folks will no doubt be rejoicing over a beta that was quietly released last Tuesday afternoon. Front Page Server Extensions are now available for Vista and Longorn Server. I thought that perhaps this could open the door to developing ASP.NET 1.1 apps on Vista using Visual Studio 2003, so I decided to do a quick test. You see, VS2005 is very versatile as to how it can open webs, but when Visual Studio 2003 opens a web site, it can only use FPSE. And the lack of FPSE ......

Posted On Monday, May 7, 2007 12:22 PM

MIX keynote is rockin'
It's a great keynote going on this morning out here at the Venetian, learning about the newest of the new from Microsoft. The new beta bits for Silverlight 1.0 are now available for download, with the RTM is coming this summer. And surronding Silverlight is also the announcement of the featureset to be included in Silverlight 1.1. For that Laurent already mentioned some of the great news. Especially important is that a scaled-down version of .NET will be included in that v1.1 release. We've been ......

Posted On Monday, April 30, 2007 1:12 PM

Resolving the "Sys is undefined" error in ASP.NET AJAX RTM under IIS 7
A plea out to all those who are using ASP.NET AJAX with sites on IIS7, either under Vista or Longhorn Server: I've been battling a strange issue with ASP.NET AJAX on IIS 7 running under Vista. It's a site that was upgraded from RC1 to RTM, and works great under IIS 6. Have troubleshot it enough under IIS 7 to determine that if the AppPool has the Managed Pipeline Mode set to "Integrated", it fails, and if it's set to "Classic", it works perfectly. The error I'm getting is one that was common during ......

Posted On Wednesday, March 28, 2007 12:16 PM

The guy who wrote IE, plus the guy who wrote ASP.NET, both on stage next week in Phoenix!
Come see the original creator of ASP.NET — Scott GuthrieANDThe original creator of Internet Explorer — Eric Sinkat the beautiful Orpheum Theatre in downtown Phoenix, Arizona! Once a year AZGroups puts on a really big free event featuring in-depth technical content from top-notch industry experts. This year they’re featuring two speakers you usually only get to see during keynotes at major conferences. This world-class event is being held in the pristine Orpheum Theatre on Wednesday, ......

Posted On Tuesday, August 29, 2006 3:35 PM

Comparing Dreamweaver and Visual Studio
Dreamweaver has always offered a compelling environment to develop HTML-centric web pages, with some server-side tricks thrown in for good measure. Historically Visual Studio has offered the opposite, great server-side but a bit light on the client-side code. Visual Studio 2005 brought many enhancements that close the gap. A month ago a friend and I finished a project and submitted it to Microsoft that compares the experience between those two. So if you ever wanted to see how things are done in ......

Posted On Tuesday, August 22, 2006 8:22 AM

Come see Eric Sink and Scott Guthrie in Phoenix
The Arizona .NET User Group is proud to presentLive, for one day onlyEric Sink and Scott Guthrie My friend Scott Cate and I have been busy organizing our biggest function of the year for the Arizona .NET user group. This free all-day event will be held Wednesday September 6th at the Orpheum theater in Phoenix, Arizona. A little about our featured guests: Scott Guthrie is a General Manager within Microsoft’s Developer Division. He runs the development teams that build: ASP.NET, Atlas, Windows ......

Posted On Thursday, August 3, 2006 12:14 PM

Multi-threaded applications are a cinch in .NET
With careful programming, threads offer a great way to make your application more responsive. If you need to do some database access or call a web service, many millions of computer cycles could go unused before your application actually gets underway again. Instead of making your application sit on the bench that whole time, you may be able to keep it busy with other important tasks. This post offers a simple introduction to spawning your first thread. Here's a couple of lines that will kick off ......

Posted On Monday, July 17, 2006 10:50 AM

Now you can read between the lines of obfuscated Javascript
A few months ago I wrote a simple Javascript beautifier, which suited my needs at the time. But since then while dissecting longer AJAX-centric scripts in various websites, I found some things that were giving the beautifier some trouble. So I took some time this morning to fix a few bugs and improve overall performance. Some of you may be asking, “What is a beautifier?” Put in nasty obfuscated code that is all run together, and it spits out something that's nicely formatted and very ......

Posted On Monday, July 17, 2006 7:39 AM

Start experimenting with XAML on your XP machine in under 15 minutes!
I presented a session on WPF at the Arizona .NET User's Group last night, and today have been getting email and calls from several people who wished they could have been in attendance, and wanted to get started with WPF. So for those that weren't there last night, this post is designed as an intro to get you started. The version of Windows Presentation Foundation (WPF) included in the June CTP is very polished. Being this late in the development cycle, the things you learn now in this environment ......

Posted On Thursday, July 6, 2006 11:32 AM

Web 2.0 -- mash it up and bring it on!
With Mix06 currently underway I thought this would be a good time to blog one of my favorite quotes surrounding web mashups. This comes right from the Wikipedia definition: It is postulated that mashups are the beginning of the end for traditional operating systems. While operating systems currently serve as a collection of APIs for organizing and storing files and applications, it is quite possible that in a few years all APIs will exist entirely online, and that operating systems will be replaced ......

Posted On Monday, March 20, 2006 7:51 AM

Preventing double-posting on a web page
A question was posed to the Arizona Groups list about how to prevent double-posting to a form on a web page. My favorite solution to do this is set up a variable to track if the submit has happened yet or not. The HTML needs to end up looking like this:<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" > <HTML> <HEAD><title>Fo... <body> <script language="javascript"> var haveSubmitted=false; function FirstSubmitOnly() { ......

Posted On Sunday, March 12, 2006 5:55 PM

Handling timeouts gracefully in AJAX using client-side code
This question was posted to the AZGroups list: Has anyone come up with a solution for handling timeout issues related toAJAX, especially with regard to allowing the user to cancel a request? Thisincludes cancelling the response to the client as well as notifyingthe server that the request has been cancelled, allowing the server topossibly kill the request process. AJAX comes in many flavors, so for this sample I'll just write the most generic callback code possible in Javascript using XMLHttpRequest. ......

Posted On Tuesday, March 7, 2006 7:27 AM

To satisfy your reverse-engineering cravings: a free online Javascript beautifier
Lately in my day job I've been troubleshooting ASP.NET pages that use server controls that lean heavily on Javascript. The kind of Javascript that is stripped and streamlined with zero whitespace or carriage returns. So to make any sense of it at all I needed a beautifier: function layoutmouseup() {if ((moving != 0) && (target != 0)) {rearrange(moving, movingcol, target, targetcol);var targ = target;if (movingcol == targetcol && target > moving) {targ = targ - 1;}displaylayout();}moving ......

Posted On Saturday, February 25, 2006 7:09 AM

Performance of the new SqlDataSource component in ASP.NET 2.0
While teaching the ASP.NET 2.0 class (3201) in Baton Rouge, some questions about performance came up surrounding the new DataSource classes. I had actually meant to get all this testing done and posted by the middle of last week, so for those waiting to see these results, thanks very much for your patience. Altogether this became a fun little experiment, and more time consuming than I expected! I hope you find the results useful. To get started let's review the type of design-time fun we could have ......

Posted On Monday, February 20, 2006 4:25 PM

Baton Rouge trip, part 1
Over the past week I taught two .NET classes in hurricane-struck Baton Rouge, Louisiana. I flew into New Orleans, arriving Saturday night. Instead of hitting the hotel I drove directly to the French Quarter to see what was still standing after the storm. On the way it was interesting to see an occasional boat resting on the roadside. Upon arriving in the historic downtown to my delight all of my favorite places looked fairly intact. Even in the surrounding areas the classic century-old wooden houses ......

Posted On Monday, February 13, 2006 4:51 AM

AJAX as an attack vector
Had this question posed from a friend in my last London post: What do you think of AJAX? Do you know of security concerns? Since you asked... Security concerns with AJAXAJAX is a very straightforward way to increase the dynamic feel of any site. But we're talking about Javascript calling almost directly into server-side code, so there are some big security concerns to be worried about with this architecture. What was once one door into the server, a URL to retrieve the web page, is now accompanied ......

Posted On Thursday, February 9, 2006 1:15 AM

C# code to determine which versions of the .NET Framework are installed on a system, along with hotfixes and Service Packs
There was a question that surfaced on the Arizona .NET User Group list about determining which versions of .NET are on a system, and which service packs have been applied. It sounded like a fun challenge, so I spent a few minutes this afternoon learning about how to dig up that data. Definitely the most helpful information came from this post in Aaron Stebner's blog, which was pointed out by my friend Tim Heuer. Aaron's sample code is only available in native C++ and VB.NET, so I decided to write ......

Posted On Monday, January 30, 2006 2:09 PM

London trip, part 2
Here's an interesting place, part jail, part armory, where the Crown Jewels are currently displayed. The Tower of London: Lots of history behind this place, often involving imprisonment and beheadings. In happier news, as promised here's the ASP.NET TreeView sample, which is written in VB.NET in VS2005: Jonathan_Treeview.zip It demonstrates the new TreeView control in ASP.NET 2.0, how recursive routines work, and how to extend the standard TreeNode class to support enhanced functionality. ......

Posted On Friday, January 20, 2006 7:27 AM

London trip, part 1
Last week I had the pleasure of teaching an ASP.NET class in a little town called Weybridge, just outside of London. Being from the sun-soaked desert, it was quite a treat to spend time in a countryside so verdant. And the history of the city was enthralling. The class was held in a building over 200 years old, the town's old post office. It has now been renovated and is owned by a computer consulting firm: (The presence of the mail van is purely coincidental!) One of the students in my class gave ......

Posted On Thursday, January 19, 2006 6:12 AM

Using client certificates with ASP.NET
Here's a fun question that came through the Arizona .NET User's Group list about using client certificates with ASP.NET: Question:How do you set up a client x509 certificate to be used by code run by an ASP.NET process? This article didn't help: http://support.microsoft.co... The WinHttpCertCfg.exe util would not install certs into the store. I had to use the mmc certificates plugin. The workaround I did in development was to log in as the web user and install the ......

Posted On Friday, December 30, 2005 3:35 PM

Scouting around the cells in an ASP.NET DataGrid using JavaScript
Yesterday the question was posted to the Arizona Groups list: How do you use client-side code to read the selected value in a drop-down list contained in a DataGrid cell when the user clicks on an <img> tag in an adjoining cell? This can be done quite easily with JavaScript. One cool thing about HTML elements in general is that from wherever you are, you can navigate four ways: to an element's parent, first child, previous sibling, or next sibling. This allows you to effectively "walk" throughout ......

Posted On Friday, December 16, 2005 2:28 AM

Scrolling an ASP.NET ListBox to right where you want it to be
Yesterday the question was posted to the Arizona Groups list: How do you have the selected values in an ASP.Net Listbox control scroll into view? Simple answer: By default in IE whatever is selected does get scrolled to the top. In ASP.NET, the ListBox is rendered as a <SELECT> element with a SIZE attribute. For whatever item is selected, as appropriate the selected attribute gets applied. Here's an example to set the stage, both the HTML generated by ASP.NET and the actual control: Red Green ......

Posted On Friday, December 16, 2005 1:03 AM

What??? You deleted "Default Web Site" from IIS?!?!
Some applications are just bent on seeing what appears to be the pristine original Default Web Site that is created when IIS is first installed. For instance, when setting up Microsoft's own Reporting Services it depends upon having a web with the same underlying site ID as the default, “W3SVC/1“. So you can paint yourself in a corner if you ever get a wild hair and just up and delete it one day: To these finicky apps, anything created after the fact, even if it is called by the right ......

Posted On Friday, December 9, 2005 8:18 PM

ASP.NET Compiler Error CS0006
Do you have arcane CS0006 errors haunting you, either in 1.1 or 2.0? Something like this: Compiler Error Message: CS0006: Metadata file 'C:\WINDOWS\Microsoft.NET\F... ASP.NET Files\someProject\27bee1ac\... could not be foundSource Error: [No relevant source lines] Additional symptoms: when you first build the app it works fine, but then when rebuilding it always comes up with this error. Well, I know of three major reasons for this to occur: You've ......

Posted On Friday, December 9, 2005 12:40 AM

Max for the Web - Part 1: Matrix Transforms in GDI+
A friend of mine, Scott Cate, recently gave me a challenge to create an ASP.NET server control that renders images similar to Microsoft Max. That is with a little tilt and some reflection below as if it were sitting on a glass table. This is the first of three posts in which I'll detail how to make that happen. Overall the real challenge comes in getting GDI+ to do anything resembling 3D. It will do great 2D things all day long. Part of the namespace is appropriately called “Drawing2D”! ......

Posted On Wednesday, November 23, 2005 7:01 AM

I will only use my Chromeless powers for good
One of my acquaintances, a fellow MCT, happened upon a phishing scam that makes use of chromeless windows. He hadn't seen it in action before, so I put together this post to demonstrate the potential evils. Note that if you are using XP with SP2 then it won't be that impressive! This security hole has been plugged pretty well with that patch.For those browsing with IE and without XP SP2, watch what happens to the URL in your address bar when you click the button. Now edit what's in the textbox and ......

Posted On Tuesday, November 22, 2005 1:24 AM

Copyright © Lorin Thwaits | Powered by: GeeksWithBlogs.net