FrontPage creates html/asp mixed pages

Source: Internet
Author: User
Tags end html page include mixed numeric value variables string
frontpage| Create | page

I've been using Microsoft's FrontPage 98来 to develop Internet database applications such as Asp/ado. Now I hear that a lot of people are embracing InterDev as a tool for developing those programs because they think FrontPage is messing with the code. But here, I'd like to cite some excellent reasons why I prefer FrontPage.

Many of my clients are entrepreneurs who believe that for a Web site, FrontPage and other WYSIWYG Web site development tools can create pages without programming. Of course, "no programming" is for certain content, not about ASP's site.

You can use Notepad, other text editors, or Visual InterDev to create an ASP Web page that works well, but if you are processed by FrontPage or any other WYSIWYG editor, your code will become messy. Because these editors cannot read and understand the ASP script in the page, they think that the page code has been wrong and then "corrected" it.

However, if you understand what FrontPage likes and dislikes, and you know your code, you'll see that all the problems are gone. The FrontPage Editor does create ASP pages, just like you can do with Notepad, Visual InterDev, and so on.

So where is the advantage? I can give programmers 100 dollars an hour, but my clients don't want to pay $100 per hour for HTML design. For this reason, they either design them themselves, or hire people to design and then pay for the expenses. I write ASP code in the page and then deliver it to them. Then, if they want to make changes to the style of the program, they can open the page in FrontPage or other WYSIWYG editors, and simply and quickly modify the HTML page even without programming knowledge.

Example

Let me give you an example. The discussion here is for FrontPage 98, which is not as user-friendly as FrontPage 2000, but is widely used.

Imagine that there is a form on the page where you want to conditionally set the Action property of the form based on the variables passed over from the query string. You can write several form tags and use the values of the variables to choose which form to place on the page. For the purposes of the discussion, enclose the HTML code in square brackets.

<%
Dim MyVar
MyVar = Request.QueryString ("MyVar")%>
<%if myvar = "1" then%>
[<form name= "MyForm" action= "mypage1.asp" METHOD=POST&GT;]
<%elseif MyVar = "2" then%>
[<form name= "MyForm" action= "mypage2.asp" METHOD=POST&GT;]
<%elseif MyVar = "3" then%>
[<form name= "MyForm" action= "mypage3.asp" METHOD=POST&GT;]
<%else%>
[<form name= "MyForm" action= "mypage4.asp" METHOD=POST&GT;]
<%end if

%>
' Form HTML here
[</form>]

What's going to happen? FrontPage has added a string of </form > tags, so 4 separate forms have been created on the page. This is not what we need, for this example, let's forget to use FrontPage, okay? Oh no! Try the following code:

<%
Dim MyVar, Straction
MyVar = Request.QueryString ("MyVar")

If MyVar = "1" Then
straction = "Mypage1.asp"
ElseIf myvar = "2" Then
straction = "Mypage2.asp"
ElseIf myvar = "3" Then
straction = "Mypage3.asp"
Else
straction = "Mypage4.asp"
End If
%>

[<form name= "MyForm" action= "]<%=straction%>" [method= "POST"] >

' Form HTML here ...

[</form>]

Instead of writing the entire form tag, only a small piece of code is written to define the numeric value of the string variable and then merge it into a single form definition. Look! FrontPage is just right, customers can do it freely!

This technique can be applied to any kind of object on the page. Do not have to write a complete HTML code, only in the ASP code block to replace the different variables can be!

How to apply FrontPage to accelerate product development

Here are some things that are fully applied to FrontPage when developing ASP pages. Not long ago, I wanted to construct a inclusion file that would randomly display some books from the Amazon.com online bookstore, just like the following:

The job will include: Create a fixed-width table that incorporates a piece of code that selects a random heading from 15 different headings, displays a graph of the related graphics in Amazon, a graphic of the book title, and the name of the book, along with a URL link that resides in the location of the Web site. In the desired page, you can insert this small table, using the following code:<% #INCLUDE file= "Books.inc"%>.



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.