Article
Dr Design Answers your Questions
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 SitesThough there are literally thousands of ASP-based sites around, here's a list of our favorites -- they're the most comprehensive and useful.
- LearnASP
- 4Guys From Rolla
- ASP101
- ASP Zone
- ASP Today
- TotalASP
- DevDex -- ASP
- ASP FAQs
- ASP Emporium
- ASPAlliance
- ASP Programmers resource
- adOpenStatic (a small site but a real gem. Has the best article I've ever read (online or off) regarding data validation)
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.
- Active Server Pages Guide
- Platform SDK: Internet Information Services 5.1 - Visual Basic Object Model
- ADO Programmer's Guide
- ADO API Reference
- Introduction to CDO for NTS
- About CDO for Windows 2000
- MSDN Magazine - loads of articles covering ASP/ADO/COM/XML etc
Miscellaneous MS Database Links
Several especially important parts of the MSDN are those related to Microsoft's databases. Here are a few important aspects:
- Fundamental Microsoft Jet SQL for Access 2000
- Intermediate Microsoft Jet SQL for Access 2000
- Advanced Microsoft Jet SQL for Access 2000
- SQL Server
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.
Dr Design answers design and development questions for SitePoint readers.