Article

Home » Design and Layout » Design Tips & Tricks » Dr Design Answers your Questions

About the Author

Dr. Design

author_drdesign Dr Design answers design and development questions for SitePoint readers. Drop him a line today!

View all articles by Dr. Design...

Dr Design Answers your Questions

By Dr. Design

March 23rd, 2002

Reader Rating: 8

Page: 1 2 Next

After a very long hiatus, Dr. Design is back! He's found his stethoscope, donned a white coat, and is now seeing patients. So if your layout's ailing, you've got a chill in your PNGs, or you need a little something for those troublesome stylesheets, why not seek a consultation? The good Doctor is in!

Finicky Frames

Dear Dr. Design,
I have a site that uses frames. I'm able to change the content of a single frame when a user clicks a link. But now I want to know how I can change the content in multiple frames when the user clicks a single link. Can you help me?

As I'm sure you're aware, most frame links look something like this:

<a href="hello.html" target="main">my link</a>

By using a bit of smart JavaScript like this:

<script language="javascript" type="text/js">
<!--

function doSwitch(frame1,frame2,frame1loc,frame2loc)
{
top.frame1.location.href=frame1loc;
top.frame2.location.href=frame2loc;
}

// -->
</script>

you can reuse the code. This allows you to do stuff like:

<a href="doSwitch('main','top','main.asp','top.asp');"> test</a>

Let's just step back a second here. There's no need to adjust the JavaScript. The only aspect that'll change is the code inside doSwitch(). By using encapsulated JavaScript like that above, we save ourselves needing to write a function for each and every link.

Make default.asp Your Main Page

Dr. Design, I'm using ASP on an NT server and was wondering if there was an easy way I could make default.asp the main page that loads (instead of index.html or .htm)? Do I need to contact my host, or is there a way I can do this automatically?

This is a great question -- though the answer may not be what you expected. Many hosts employ very strong Control Panels, which can often be found at www.mydomain.com/cp or some similar address. If your host either does not have a Control Panel, or the Control Panel does not give you the option to specify Default Home Pages, you need to contact them in order to effect the change.

Because of the way Internet Information Server is set up, there is a list of default pages it looks for whenever a directory (www.mydomain.com/mydirectory) is accessed without a specified file. IIS maintains a list (set up by your host) of the files which are "allowed" to be Default Home Pages. Setting this up is actually a fairly simple task, but the fact that your default.asp page isn't showing up suggests you will need to contact them in order to ask them to add it to the list. It's literally a 20 second job. Good luck!

ASP Resources

Hey Dr. Design, is there such a thing as an ASP manual (sort of an equivalent to the PHP manual for ASP)? What are some good resources for learning ASP?

I'll defer this question to the members of the SitePointForums, as they've amassed an amazing list of resources. I think this list is about as complete as can be, and I'd recommend that you save this somewhere handy.

General ASP Sites

Though there are literally thousands of ASP-based sites around, here's a list of our favorites -- they're the most comprehensive and useful.

Microsoft Links

As the developer of ASP, Microsoft has provided a veritable treasure trove of resources, chief among which is the Microsoft Developers Network (MSDN). These documents can be confusing, but are worth digging through.

Miscellaneous MS Database Links

Several especially important parts of the MSDN are those related to Microsoft's databases. Here are a few important aspects:

ASP Documentation

ASP Documentation is available with every full install of Microsoft Internet Information Server. It is viewable through http://localhost/iishelp if this is installed. If not, check your installation options. Though Microsoft Personal Web Server does allow ASP, and does provide ASP documentation, it can be both sparse and inaccurate.

If you liked this article, share the love:
Print-Friendly Version Suggest an Article

Sponsored Links