Chris Pietschmann

husband, father, hacker, entrepreneur, futurist, innovator, autodidact


ASP.NET Atlas is full of JavaScript goodness

I was looking through the JavaScript code for Atlas and I noticed there is some pretty neat stuff in there. It is really a very large enhancement to JavaScript. One of the things I noticed is they are adding support for the XMLHttpRequest object if the browser doesn't natively support it. In the past I've traditionally just created a function named similarly to 'CreateXMLHttpRequestObject' and I make that function support multiple browsers. The technique that's used in Atlas is they are adding ... [More]

ASP.NET 2.0: Virtual Earth v3 Ajax Server Control - PietschSoft.VE3 v0.01

Here is v0.01 of my ASP.NET Virtual Earth v3 custom control. The zip file download contains the DLL code and a sample test website. PietschSoft.VE3 v0.01 Features: Display map on a page with server side parameters (latitude, longitude, zoom, map style, etc.) Ability to attach JavaScript functions to the events raised by the JavaScript VEMap object from within server side code. Ability to plot points on the map from with in server side code I am modeling the objects in my li... [More]

ASP.NET 2.0: Place JavaScript inside the Page.Header

The Page.ClientScript object allows you to place JavaScript inside the Page, but it's limited in the fact that you cannot use it to place JavaScript inside the Head tags of the Page. But fortunately there is a way to do this. Add a .js file include inside the page header: [code:c#] HtmlGenericControl Include = new HtmlGenericControl("script"); Include.Attributes.Add("type", "text/javascript"); Include.Attributes.Add("src", ""); this.Page.H... [More]

What I've been up to lately: JavaScript, AJAX, Virtual Earth and WebParts

The last couple months at work, I've been working a lot on a new real estate mapping product that was launched last week called eNavigator (Try out eNavigator here). It utilizes AJAX and the Microsoft Virtual Earth v1 Commercial control and supports IE and Firefox. The coolest feature is the Interactive Map search that allows you to click and drag the map around to find that home of your dreams. Something I started working with tonight is the new Virtual Earth v... [More]

MSDN .NET Show on IIS 7.0 with Scott Guthrie and Bill Staples

The latest episode of the MSDN .NET Show features a great interview with Scott Guthrie and Bill Staples on IIS 7.0. The show includes a 30 minute interview about the product, along with 30 minutes of demos. IIS 7.0 on the MSDN .NET Show The latest IIS 7.0 Beta will be included in Windows Vista Beta 2. Also, it will be shipping with Vista, and will be included in the "home" editions as well. I'm hoping the final release of IIS 7 will ship with the RTM of Vista, and I don't have to wait for... [More]

ASP.NET 2.0: It's extremely easy to add Ajax support using "Atlas"

Since ASP.NET "Atlas" has a Go Live license, I decided to check it out. I looked at the quick start samples and a short video that Scott Guthrie posted on using "Atlas". I've done some cool things with Ajax in Classic ASP and ASP.NET by hand coding all the JavaScript myseleft. Now with "Atlas" it's extremely simple to do, and you don't even need to know JavaScript to add Ajax support to your existing applications! It couldn't be easier to do. I can't wait to dig in to the more advanced... [More]

ASP.NET: Registration of Controls in Web.Config

In ASP.NET 1.x controls had to be registered in each page they were used. New since ASP.NET 2.0, controls can be registered in the web.config file. Visual Studio 2005 supports full intellisense when editing .aspx pages. This feature allows commonly used controls to be more easily used through out your application. Web.Config <system.web> <pages> <controls> <add tagPrefix="mycontrol" src="~/Controls/Header.ascx" tagName="header"/> <ad... [More]

ASP.NET: Maintain Scroll Position On Postback

The MaintainScrollPositionOnPostback page directive attribute allows pages to automatically maintain the current scroll position across postbacks. This feature is usefull for large pages where scrolling is necessary to view input controls down further on the page. This works in ASP.NET 2.0 and later.

<%@ Page MaintainScrollPositionOnPostback="true" %>
A simple but very usefull feature.

ASP.NET: The secret App_Offline.htm file

If you place a file named app_offline.htm into the root of an ASP.NET 2.0 application, the application will shutdown and any page request for the application will return this file instead. This feature makes it extremely easy to take down an application while a large update is being made. As soon as you remove the file any page requests to the application will continue as normal. This works with ASP.NET 2.0 and later.

ASP.NET 2.0: "Atlas" now has a Go-Live license

At last, the new March ASP.NET "Atlas" CTP comes with Go-Live. I downloaded the latest release and am planning on playing around with it alot soon. I've been waiting for it to have a Go-Live license so I can use it in some of my personal projects I'm working on. If you don't know what ASP.NET "Atlas" is; it's basically an AJAX (Asynchronous Javascript And Xml) framework for ASP.NET 2.0. They are also expected to be releaseing an Atlas Refresh this month, which includes bug fixes and more featu... [More]

ASP.NET: Use VB.NET and C# within the App_Code folder

When I was creating my new blog site (this site your looking at), I chose to write it in C#. I had a problem with the App_Code folder because I had some code in VB.NET code and some C# code I needed to put in there. I didn't want to rewrite my VB.NET code in the App_Code folder just so I could write the rest of the code for the site in C#. Luckily, the ASP.NET Team had already thought about just this kind of circumstance. They implemented a way to partition the App_Code folder into sub-fold... [More]

ASP.NET Development Server: Run application on Root

The ASP.NET Development Server inside Visual Studio 2005 runs the web application in a subfolder by default instead of on the root. This is an annouance for some. Can't it be configured to run the web app in the root? Yes, it can and theres an explanation of how to configure it on Scott Guthries blog. "How to Run a Root “/” Site with the VS/VWD 2005 Local Web Server"

ASP.NET: How to get a specific ConnectionString from the Web.Config by name

You have your ConnectionString for your ASP.NET web app stored in the Web.Config file. Now how exactly how do you get that ConnectionString out of there from within your code? Sample Web.Config section with a ConnectionString: <connectionStrings> <remove name="LocalSqlServer" /> <add name="LocalSqlServer" connectionString="Data Source=myDBServer;database=myDB;Integrated Security=True;" providerName="System.Data.SqlCl... [More]

ASP.NET Client Callbacks inside a User Control

Implementing Client Callbacks (AJAX) in ASP.NET 2.0 is actually really simple to do as long as you know a little JavaScript. Heres is a small example of using a Client Callback from within a User Control. I've tested this example with IE6 and Firefox 1.5 1 <%@ Control Language="VB" ClassName="ClientCallbackControl"%> 2 <%@ Implements Interface="System.Web.UI.ICallbackEventHandler"%> 3 <script runat="server"> 4 ''This is the variable that holds the client callback ... [More]

ASP.NET 2.0: URL Mapping with RegEx Support

The one big limitation of the URL Mapping functionality built in to ASP.NET 2.0 is that it doesn't support regular expressions. I ported my v1.1 URL Mapping implementation over to v2.0 and added support for regular expressions. It really wasn't too difficult; I only had to modify two lines of code to port it over to ASP.NET 2.0. Then I had to modify 4 lines of code to add RegEx support. My implementation works just like the ASP.NET 2.0 URL Mapping functionality with the addition of RegEx... [More]

Configure Visual Studio 2005 for "Classic" ASP syntax highlighting and intellisense

You can use the Visual Studio 2005 IDE to edit your Classic ASP files and still utilize syntax highlighting and intellisense. All you have to do is associate the “.asp“ file extension with the Web Form Editor. When doing this you are telling the IDE to treat “.asp“ files the same as “.aspx“ files, in turn sort of “tricking“ the IDE in to giving you the syntax highlighting and intellisense that you want. The steps in setting up the IDE are as follo... [More]

A deep talk about ASP.NET Web Controls

This is another great episode of The .NET Rocks show. This weeks episode is all about writing Web Controls in ASP.NET. I think this is one of the more advanced topics they've covered on the show. I listened to it a couple times and since I don't author too many user controls, I think I'll have to play with more of the stuff they discuss. Miguel Castro on Web ControlsCarl and Richard run into Miguel Castro at a hotel bar at the MVP Summit 2005 in Bellevue, WA. This is the first real show we've d... [More]

Use ASP.NET Web Parts and Membership stuff with SQL Server 2000

By default ASP.NET 2.0 Web Parts uses SQL Express. To use this stuff with SQL Server 2000 you must configure the aspnetdb database on your SQL Server 2000 database server. Fortunately for us, Microsoft has created a utility to automate the process. Follow these steps to setup the aspnetdb database: 1) run the utility - C:\WINDOWS\Microsoft.NET\Framework\v2.0.50215\aspnet_regsql.exe (this was written with ASP.NET 2.0 Beta 2 (v2.0.50215) as a reference, so with the final rele... [More]

URL Mapping for ASP.NET 1.1

With the help of an http module, a custom config handler and a few lines of code we can add the same ASP.NET 2.0 style URL Mapping to our ASP.NET 1.1 apps. 1) First lets start by creating a new Class Library project named 'URLMapping_HTTPModule' 2) Then create three files as listed below: BaseModuleRewriter.vb Imports System.Web Public Class BaseModuleRewriter     Implements System.Web.IHttpModule     Sub Init(ByVal app As HttpApplication) Implements IHttpModu... [More]

ASP.NET 2.0: Rewriting URL Paths just got a whole lot easier

Rewriting URL paths in ASP.NET 2.0 is referred to as URL Mapping. Instead of putting some code in your Application_BeginRequest method, you can now just put a few lines in your Web.Config file and like magic you can rewrite those URL paths with ease. With URL Mapping you can turn a not so freindly URL like ~/Blog/Post/11/12/2005/145.aspx into ~/TheCoolestPost.aspx Example Web.Config File: [code:html] <?xml version="1.0" ?> <configuration xmlns="http://sch... [More]

Boolean Expression in .NET: strName IN ("CHRIS","TOM","TYLER")

I think it would be really helpful if we could do boolean expressions with IN sort of like we can in SQL. For Example:   'just like SQL   If strName IN ("CHRIS","TOM","TYLER") Then      'do something   End If    'using an array for this would be best   Dim arrNames() AS String = New Array{"CHRIS", "TOM", "TYLER"}   If strName IN arrNames Then      'do something   End If &nbs... [More]

Giving your application a Plugin based architecture is easier than it sounds...

I've been playing around the last couple of days with creating an application with a Plugin based architecture. It's alot easier with .NET than it sounds. I don't have any examples or articles to post on here yet, but I'm working on something I hope to have up here in the next week or so. On another note, the traffic of my site is using about 1GB of bandwidth per month now (consistantly the last two months). That's the most my site has ever used, I'm going to have to upgrade my hosting account ... [More]

Why can't IIS implicitly share ASP Session state with ASP.NET??

Why can't IIS implicitly share ASP Session state with ASP.NET?? This is really a drag on starting to convert an ASP application to ASP.NET. Of course, you could use SQL Server to store your Sessions state, but then you'd have to rewrite that portion of your ASP application first. I don't want to, Why can't I just use Session(”myData”) in ASP and ASP.NET and have it point to the same Session value? C'mon guys!!