Developing ASP with FRONTPAGE98

Source: Internet
Author: User
Tags format exit dsn header html page odbc variables web services
With the rapid development of internet/intranet and Web technology, Internet users are not only satisfied with browsing static Web content, but also want to get the necessary information through the dynamic interactive mode of man-machine conversation, while for Web developers, static Web pages occupy more disk space, disperse information content, Maintain update difficulties and other issues.   Therefore, it is desirable to use dynamic interactive Web pages to publish information on the Web. The traditional way of generating dynamic web pages, such as CGI and ISAPI, has some defects such as high overhead, low efficiency, difficulty in development and close integration with HTML language. ASP (Activeserverpages, Chinese translated "Dynamic Server Web Page") as Microsoft launched a new generation of Dynamic Web page development technology, just make up for these defects, it is easy to generate, object-oriented, scalable, security, wide range of applications and full integration with the HTML features. Regarding its working principle and the technical characteristic, "The computer World" has made the thorough detailed special report, this article does not repeat.

Because the development of ASP needs programming, often make beginners discouraged. FrontPage98 as the most popular web site development tool, with easy to use, visualization and so on. Some people think that FrontPage98 can only play the role of organizing, managing websites and modifying pages, and not doing anything for the development of ASP. In fact, FrontPage98 internal support for the ASP, so that developers do not have to programming, as long as the writing of a few SQL statements, you can quickly generate a database interface with the background of ASP pages, is the development of ASP is a good starter tool. This paper will introduce this technology, and the advantages and disadvantages of this technology, and the combination of hand-written methods to be elaborated.

How to generate ASP pages with FRONTPAGE98:

First, make sure your system meets the requirements of running ASP, namely: your Web server is one of the following:

Microsoft Internet information server3.0/4.0forwindowsnt;

Microsoft Peer Web Services for Windows NT;

Microsoft Personal Web Server for Windows 95/98.

Your server has 32-bit ODBC drivers for the database you use (including access, SQL Server, Oracle, FoxPro, etc., all of which are ODBC-enabled databases), and if not, install the database's client software on the server.

Frontpage98serverextensions is installed on your server (FRONTPAGE98 server extensions are automatically mounted when you install FP98). Your server has an ASP engine installed (run the IIS installation disk or FP98 disk in the ASP.EXE file can be installed, you can also download the following URL:www.microsoft.com/msdownload/iis3/Download2.asp?Prod=1). For IIS4 or PWSforWIN98, the above "3", "4" Steps have been set up when installed, do not have to install. In addition, the Order of "1", "3", "4" installation cannot be disturbed.

Second, in the Control Panel | In ODBC, define the DSN data source for the database you want to use, and note that you want to define it as a "system data source."

Third, set up a database query page, in FrontPage98 Explorer, create a new normal HTML page, insert a Form object above, such as a single-line text box, and named "T1", in the area of the form in the right mouse click, in the pop-up menu midpoint " Formproperties, select "Sendtoother:", select "Customisapi,nsapi,cgi,oraspscript" in the Drop-down list, and click Options, In the pop-up dialog box, indicate the relative path and filename of the target ASP page, such as "asp/list.asp", so that the page will automatically go to the ASP page as soon as the user presses "submit" in the browser.

The establishment of the database query results display page. Use FrontPage98 's Explorer to create a new directory in the Web site, named "ASP" (or other name), giving the directory permission to execute the program's properties and cancel the readable property of the directory, creating a new Web page in this directory and naming it list.asp. The filename suffix for an ASP Web page must be ". asp", which is specified. It is best to put all ASP files in the same directory. Open this page with FrontPageEditor by selecting a menu insert| database| Databaseregionwizard, enter Wizard. In Odbcdatasourcename (DSN), enter the name of the DSN data source (that is, the previous "two" steps are defined in ODBC), and if the database has a user name and password, select the Username and Password check boxes and enter the contents. After the loss, click NEXT. Enter the SQL query statement in "Enterthesqlstringforthequery", such as "Select *fromtablewherename= '%%t1%%" (table is the name of the database, name is the field name), If there is data submitted from form in the statement, precede it with a "percent percent", such as "T1" should be changed to "%%t1%%". If you click "Insertformfieldparameter" to add the data submitted by form, "percent" will be automatically added.

You can also use "Pastesqlfromclipboard" to paste SQL statements from the Clipboard. After the loss, click NEXT. Point "AddField", enter the field name, and in "Enterthequeryfieldnames", add the field (at least one) to display in the result. If you want to output the results in a tabular format, select the Showthequeryinatable check box. Finally click Finish so that an ASP page is generated. Further adjust the appearance of the output until satisfied.

Note that the header text can be arbitrarily modified, but the "database:xxxx" part of the robot control cannot be modified, but can be moved or deleted. If you need to modify the previously entered DSN data source, SQL statement or add or subtract the fields shown in the results, move the mouse over the wizard-generated section, right-click when the mouse becomes a small robot, and select "Databaseregionproperties" or "" in the pop-up menu. Databasecolumnvalueproperties "to make changes. Advantages and disadvantages of generating ASP pages with FRONTPAGE98.


According to the author's experience, using Databaseregionwizard to generate ASP pages, has the following advantages:

First, do not write code, fast and efficient, simple, suitable for beginners and non-professional professionals. You only need to construct your SQL query statement, other things can be assured to wizard to do, faster than their own hand-written.

Second, the process of strict input control, effectively avoid illegal character intrusion.

The procedure generated by the Databaseregionwizard, by adding "% percent" to the data submitted by the form and checking it during execution, and by filtering the "" "," "(i.e., single double quotes) in the submitted data in layers, Avoids program run errors caused by form submission of illegal data. When you write ASP pages manually, these are handled by yourself.

Third, can through the frontpageeditor to the output result the format to make the direct adjustment, causes the output result to be more beautiful.

Typically, because ASP pages are dynamically generated, hand-written ASP pages cannot be adjusted because they are not running in frontpageeditor, so they cannot see the style of output results, and wizard generated ASP pages, The Frontpagewebbot (robot) provides a preview of the output, and you can adjust the appearance of the output as you would any static text or table. However, overly automated processing sometimes implies a loss of flexibility. Wizard for us to bring convenience at the same time, also weakened the ASP program to run the freedom, for our meticulous control program brought some trouble. If you use Wizard to generate an ASP page, and then click on the "HTML" card in the FrontPageEditor, insert some of your own ASP code in HTML editing, such as automatic paging code, and then save and exit, FrontPageEditor will pop up a "thecontentsofafrontpagecomponenthavebeenmodified."
Thesecontentswillbeoverwrittenwhenyousavethispage ", and there is only one" OK "button so that most of the ASP code you insert in HTML will not be saved. The author has made such a mistake, the result of painstaking writing of large sections of code are in vain.

Combined with hand-written ASP code

How can I make wizard generated code coexist in the same ASP page with hand-written ASP code? The method is: first with FrontPageEditor open ASP page, adjust easy to use wizard Automatic processing part, as well as all want with frontpageeditor processing part, such as the page appearance adjustment and so on, save to withdraw. Right-click the icon for the ASP page in Frontpageexplorer's Folders view, select "Open With ..." In the pop-up menu, and select "TextEditor (notepad.exe)" In the option that appears, and the ASP page opens in Notepad. Enter your own ASP code, please note the following points:

First, in the "" part of the automatic processing of FrontPage robot parts, it is best not to change, but you can change the following sentence: "norecordfound!", the usual occurrence of this sentence in the local double quotation marks in the part of: "Sorry!" There are no records to meet the requirements. "or simply with double quotes, so that when no record is returned, English" norecordfound! "is not displayed. Out.

Second, <% ... Part of the%> is the code portion of the ASP. You can be in the existing <% ... Insert your own ASP code in the%> section, or you can insert <% in an HTML statement ... %> to open up its own ASP code area. Of course, you should first read the automatically generated ASP code, understand its process control and the meaning of the main variables, and then add their own code, such as paging control. Because variables in auto-generated ASP code use descriptive phrases, it should be easy to understand.

Third, for existing HTML and wizard generated ASP code, can also be slightly adjusted as needed. For example, when you run an ASP page generated by wizard, if you are outputting the results in a tabular format, a single row of headers will appear on the page when no records are returned, because wizard the rows of HTML statements that generate the headers before the ASP statements that determine if a record returns. , you can move it to the back so that the header is displayed only when records are returned.

Four, save after the exit, remember that it is best not to use FrontPageEditor to open this page, even if you do not open the disk, or most of the hand-added ASP code will be cleared. If you want to edit it, open it in Notepad (Notepad).

The author has developed such ASP applications as user feedback, library database query and so on. Generally are first to use Databaseregionwizard to generate an ASP program framework, and then use FrontPageEditor to finish the appearance, and finally with TextEditor (Notepad) to add their own personalized control, such as the output of paging control results. In the case of limited time and not very complicated requirements, this approach does have a multiplier effect. Of course, if you have more time and energy, want to further optimize your ASP page, suggest you better use ASP's dedicated development tools, such as InterDev. By the way, it's a lot of land.



Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.