Chris Pietschmann

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

NAVIGATION - SEARCH

Scott Guthrie interviewed on Hanselminutes

Scott Hanselmen interviews Scott Guthrie (ScottGu) covering Ajax, ASP.NET 2.0, extender controls, CSS adapters and more. I'm sure you know who Scott Guthrie is, but just in case you don't: He's a General Manager within the Microsoft Developer Division, and he heads up the dev teams that work on .NET CLR, .NET Compact Framework, ASP.NET / Atlas, Windows Forms, WPF, IIS7, Commerce Server, Visual Web Developer and Visual Studio Tools for Avalon (WPF). Download here: Hanselminutes: <Scott ... [More]

ASP.NET: Extend BoundField Control - Add MultiLine support

I've been working with the data controls and it's somewhat cumbersome to use a TemplateField control everytime you want to just have a MultiLine TextBox. So, I decided to extend upon the BoundField control to add MultiLine support. It is actually rather simple to do. Using the BoundTextBoxField control in the page: <%@ Register Namespace="CustomBoundField" TagPrefix="custom" %> <asp:GridView ID="GridView1" runat="server"><Columns><custom:BoundTextBoxField ... [More]

VirtualPathProvider: Store .ASPX and .HTM files for your application in xml file or database

With the VirtualPathProvider you can server pages from your website without the files actually existing on the disk. And this doesn't use url rewriting. The VirtualPathProvider actually allows you create your own virtual file system within your application. You can store the pages of you site within an xml file, a database or any other method you would like. In my opinion this is one of the coolest new features in ASP.NET 2.0. The virtual file system you create can store virtually any file that... [More]

I Found a bug in the Rating control in the Atlas Control Toolkit

I found a bug in the current release (60731) of the Atlas Control Toolkit. The bug I found is caused when you use the Rating control within a User Control and you have multiple instances of your User Control on a page. I hope this bug gets fixed soon, it sucks for someone who likes to make things reusable using User Controls. View the Work Item I add over at CodePlex

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: 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", "http://dev.virtualearth.net/mapcontrol/v3/mapcontrol.js"); this.Page.H... [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. http://weblogs.asp.net/scottgu/archive/2005/10/06/426755.aspx

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"http://weblogs.asp.net/scottgu/archive/2005/11/21/431138.aspx

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]

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]