Hey, I could use some help from some coding pros. I’ve walked into a bad web project, I think its about to get worse so I could use some advice. I know someone out there is good at this stuff…
I’ve been working with dynamic websites with PHP/MySQL/Apache for a while, and I got hooked into trying some of their dynamic website tricks on someone’s Microsoft IIS server. They want me to build some simple dynamic pages that can get data from a MS Access database and build a page using ASP scripts. I found some really good tools in DreamWeaver UltraDev for ASP scripts, it seems to like VBScript and ASP with ADO.
However, at the last minute, the client demanded I toss in some popup menus in Javascript. It appears to me that you can only have one language per page, either javascript or VBScript. Can I have scripts from both languages on one page? I don’t quite understand the relationship between Javascript/VBScript and ASP. Fortunately (or perhaps unfortunately) UltraDev insulates me from some of this, and does some of it automatically, but I think I better figure this out.
Just to be a total pain in the ass, the client also gave me a cgi script that accesses some server in god-knows-where to download the corporation’s stock price, and spit it out in text. It looks like I’d have to wrap it in a VBScript if I want it to output on an ASP page. I’m confused. Hell, I’m burned out on this. Give me PHP/MySQL and a Mac anyday.
Yeah, BlackKnight, that’s what I figure I can do, I’ll just try putting both scripts in and see what they do. The trick is hiding it from the user who has to modify these pages. Fortunately, UltraDev has some nice features to hide the scripts. I could even make them external files, so they don’t fiddle with em.
I got these stupid Javascript/DHTML menubars up and running ok. Now I just have to get the database scripts up accessing some ADO with VBScript. Why oh why did I agree to work on Microsoft servers?
In an application like this, you’d typically use the ASP to build the Javascript code for your dropdown.
For example, you might do something like this - (for the sake of the discussion, rsData is a recordset containing the names of some people you want to put in a drop-down menu). This is in ASP-ish pseudocode, to make it easier to read
function BuildDropdown()
do
response.write (HTML option statement, with value= rsData.Fields(“Name”) and name=dropdown)
while (Not End of Recordset)
end function
Then in your html block at the end, you would have something like this:
Offhand, I can’t remember if my syntax is exactly correct, but you get the idea - you use the ASP to build your recordsets, then the ASP page builds the client page, including the options for all the dropdowns, etc. This is the standard method for working in ASP.
What language is the CGI script in? You might be better off to simply write the functionality as part of your ASP page, or build a COM object to do the work. CGI is a lousy technology, because it’s out of process and eats resources.