Some of the previously collected data---how to dynamically generate a page's structure using ASP

Source: Internet
Author: User
Tags html form html page query knowledge base
Dynamic | page lets your ASP control frame
I used to say that the use of Response.Redirect is not able to jump to another frame of the put, oh, then how do we use ASP to control the frame?
Here is a way to solve this problem.
In fact, there are two ways to control which frame the ASP-generated HTML is displayed in.
The simple one is to set the basic flag of the HTML form element. This method can solve the problem of page positioning in most simple cases.
Everyone should have seen this method, I will not elaborate.
But the question is, how do we control redirect jumps when there are some complicated situations?
Here is an example program (actually a useful example program).
It will dynamically generate a frame and can add 4 search engines to your site (if you do
If you want to add this code to your website, hehe.
Use FP to write an HTML page, the file name is frsearch.htm is divided into two frame
The frame on the left has a text box to enter the query criteria (name Searchtopic).
Plus 4 checkbox (4 query sites)
The contents are: The name of the four radio boxes is ALTAVISTA,MSKB, news, and the value of avdf,4 is on.
It is also dedicated to MSKB (MS knowledge Base) to make a drop-down box, used to select the topic used,
Name is Searcharea), there are two radio boxes, name is ViewType, and finally a submit button.
Then add the following two words to your page.
<base target= "_top" >
<form action= "dosearch.asp" >

File name is dosearch.asp
<%
Searchtopic = Request.Form ("Searchtopic")
Searchtopic = Server.URLEncode (searchtopic)
"For Microsoft KB only.
Searcharea = Request.Form ("Searcharea")
' Frame's display form
ViewType = Request.Form ("ViewType")

' The number of frame you want to show
Frcount = 0
If Request.Form ("AltaVista") = "on" Then
Avurl = "http://www.altavista.yellowpages.com.au/cgi-bin/telstra?pg=q&what=web&fmt=.&q=" & Searchtopic
Frcount = 1
End If
If Request.Form ("mskb") = "on" Then
Msurl = "Http://search.microsoft.com/searchbin/kb/mts_search.idq?" Hdr= @KBArea &scope=/kb/articles/&tmplt=mts_search&swr=f&sort=rank[d]&purl=/kb&pfx=kb &base=kb&sl=null&kbd= "& Searcharea &" &maxp=25&maxr=100&sz= "& SearchTopic
Frcount = Frcount + 1
End If
If Request.Form ("AVDF") = "on" Then
Avdfurl = "http://www.gui.com.au/gcgi/glance?tp=search.gl&query=" & Searchtopic & "&case=on& Whole=on&area=all+issues&errors=0+%28exact+match%29&maxfiles=10&maxlines=10 "
Frcount = Frcount + 1
End If
If Request.Form ("news") = "on" Then
Newsurl = "http://www.gui.com.au/gcgi/news_search?query=" & Searchtopic & "&maxresults=50&rtype=1"
Frcount = Frcount + 1
End If

If ViewType = "Frame" Then
' Dynamic Build Frame
splitpct = fix (100/frcount)
PCTs = Cstr (splitpct)
If Frcount = 1 Then
Pctstr = PCTs & "%"
End If
If Frcount > 1 Then
Pctstr = Pctstr & "," & PCTs & "%"
End If
If Frcount > 2 Then



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.