*.dannyg

VSWebCache

Mar
30

When you open a Visual Studio .NET 2003 web project, you need to have your IIS virtual directory match what is in your SLN file as well as your .webinfo file.  That IIS virtual directory needs to also map to the actual directory your project file is in.

Whenever you attempt to open a web project (csproj / vbproj) in VS2003, it will attempt to read from the VSWebCache reference first.  This can cause your development environment to break, if you happen to have moved files around since the last time you opened your project. 

Browse to the VSCache location for your user and clear out the appropriate folder to reset this.  The location is set in VS under Tools –> Options –> Projects –> Web Settings.  See screenshot below.

image

Technorati Tags: ,

URL Rewriting Problems

Mar
28

This is from a blog post that Scott Guthrie wrote on URL Rewriting (original post here: http://weblogs.asp.net/scottgu/archive/2007/02/26/tip-trick-url-rewriting-with-asp-net.aspx)

Handling CSS and Image Reference Correctly

One gotcha that people sometime run into when using Url Rewriting for the very first time is that they find that their image and CSS stylesheet references sometimes seem to stop working.  This is because they have relative references to these files within their HTML pages – and when you start to re-write URLs within an application you need to be aware that the browser will often be requesting files in different logical hierarchy levels than what is really stored on the server.

For example, if our /products.aspx page above had a relative reference to "logo.jpg" in the .aspx page, but was requested via the /products/books.aspx url, then the browser will send a request for /products/logo.jpg instead of /logo.jpg when it renders the page.  To reference this file correctly, make sure you root qualify CSS and Image references ("/style.css" instead of "style.css").  For ASP.NET controls, you can also use the ~ syntax to reference files from the root of the application (for example: <asp:image imageurl="~/images/logo.jpg" runat="server"/>

Technorati Tags: ,

ReadyBoost

Mar
25

ReBind ASPX.VB/CS (Codebehind) to ASPX

Mar
23

Something has happened to a solution file that I’m working with and the codebehind has been unbinded from it’s ASPX page.  Use the following technique to rebind in VS2003

image

Right-click an ASPX page and select “View Code” (You can highlight multiple ASPX pages, by using Ctrl+Click)

image

The code will now be rebinded, as see below.

image