labs.insert-title.com

ASP to ASP.NET I

This article documents work done on Insert Title Web Designs

For The Record

For the record I am not a coding guru, like Scott Mitchell or Stephen Walther, or Jeffery Zeldman or any of those other guys. I am however a hands on master. I can get the job done "NOW"

I work everyday in an industry that is heavily saturated and still come out ahead every time. Because I deliver the goods one way or the other.

I've been guilty of writing spaghetti code, using too many session variables and not enough stored procedures.

Skillwise, I'm capable enough to read some documentation and get out of it what i need. CSS,ASP and server-side vbscript are my primary specialties, outside of that I am pretty good with a handful of graphics apps and development tools(Mostly MX)

I understand the bare minimum of javascript and use it only as a client-side form validation tool. I have no intention of writing any of this ASP.NET in any language outside of VB, so all you C# users out there, either need to get good at changing from VB to C# (which is generally , not too complicated) or read a different article.

I do not intend to rewrite this article over and over, so you'll see as I learn from my mistakes in real-time. If one method becomes more efficient that another you won't see me changing it on all previous sections of the article. This is an evolution of someone who knows very little about ASP.NET, but has a strong understanding of Classic ASP. If this sounds like you, you'll appreciate this article. If not, you'll think it's a waste of time.

Evaluating What Needs To Be Changed.

This site currently consists of a very simple file structure and few databases which is why I think it is a perfect project for learning ASP.NET step by step while attempting to achieve all the same results.

Currently almost every page is called from the default.asp page which looks like this:



<!--#include file="open.asp" -->
<!--#include file="xml.asp" -->
<!--#include file="close.asp" -->

open.asp

The open page consists of all the meta info, calling the style sheet and top half of the graphical layout.

The open page also has an include statement for the leftBAR.asp which constitutes all the navigation at the left hand side of the page.

xml.asp

The xml.asp page is really the heart of organizing this website. Using the XMLHTTP Object I develop page upon page without the need of going through a lot of trouble to add it to the site.

Here is the xml.asp code - -it may come in handy for you.


<%
Set xml = Server.CreateObject("Microsoft.XMLHTTP")

	dim URL,page
	URL = "http://www.insert-title.com/web_design/"
	page = request.querystring("page")
		if page = "" then
			page = "dcontent"
		end if

	dim ext
	if left(page,9) = "articles/" then
		ext = ".html"
	else
		ext = ".asp"
	end if

xml.Open "GET", URL & page & ext, False
xml.Send
	Response.Write xml.responseText
Set xml = Nothing
%>

In essence what this means is that

  • a call to "http://www.insert-title.com/web_design/?page=web"
  • becomes "http://www.insert-title.com/web_design/default.asp?page=web.asp
  • and a call to "http://www.insert-title.com/web_design/?page=articles/jtops"
  • becomes "http://www.insert-title.com/web_design/default.asp?page=articles/jtops.html"

The xml.asp file picks up the content of that page and returns it in between open.asp and close.asp.

Of course, a large concern is how ASP.NET will handle the current CSS that we apply to this site. This will need to be addressed as we move along

Methodology

Here's the gameplan -

Start with the big picture get the fundamentals of the site sorted out and drill down to each single page.

Also - I dont want to rely on any GUI/IDE (i.e., Dreamweaver, VS.NET, etc.) to make any changes, so all coding will happen in my favorite coding tool, Textpad






Discussion

David

Interesting

JOOC, what do you use to enable the content negociation in IIS?

Joe Maddalone

I don`t. While I enjoy the idea of clean URLs, I just don`t care enough to worry about it.

I assume this is what you were referring to?

The system described above is basically a screen scraping process. This site, "Labs", utilizing the asp:xml object in a very similar fashion though.

Joe Maddalone

Okay.

I changed my mind. I wrote a global.asax file just today that cleans up the URLs on this site a bit.

I`ll post it once it`s perfected.

New comments are currently disabled, you can find me @joemaddalone Comments temporarily disabled for now, you can find me @joemaddalone