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]
Here's a great article on how to add support for Templates to your ASP.NET User Controls.
Updated 8/17/2007: I changed the link above since the old one I had posted is no longer there.
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]
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 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
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]
Add a .js file include inside the page header:
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.
<add tagPrefix="mycontrol" src="~/Controls/Header.ascx" tagName="header"/>
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.
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.
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.
They are also expected to be releaseing an Atlas Refresh this month, which includes bug fixes and more featu... [More]
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]
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
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" />
connectionString="Data Source=myDBServer;database=myDB;Integrated Security=True;"
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
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]
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]
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:
Public Class BaseModuleRewriter Implements System.Web.IHttpModule
Sub Init(ByVal app As HttpApplication) Implements IHttpModu... [More]