ASP application template adopted

xiaoxiao2021-03-06  121

Beginner ASP, the program can be barely written, but if every website page is revised, all source transplants will be performed. If you consume a lot of human energy, even if you don't pay attention, you will abandon it. So, dreaming that the program code of the large section becomes a few simple characters, so as long as the design of the page is inserted into it. In fact, this is also simple, just make the program code that implements this function into a child, and then the home page can be called. Many times, in the blog China, you will choose a lot of templates, and you can also be designed yourself; or use pig flying blogs to change their site is not close to the same ... These are all attributed to The ASP features a template. Then I will give a Buddha to give the template to give a group of friends. First, the template needs to be modified online, the so-called template of the database saving template code should be used, which is the standard HTML code for design and completed, which requires a special string instead of the functional part of the program. However, these special strings need to be compiled as a corresponding function when displayed. 2. Suppose the first template content code copies the following code to the M_HTML field

$ CNTOP

LT; / TD>

$ CNLT

LT; / TD>

$ CNRight

LT; / TD> Note $ CNTOP $, $ CNLEFT $, $ CNRIGHT $, which will implement some specific program features 3, establish a database connection file CONN .asp <% set conn = server.createObject ("adoDb.connection") connStr = "provider = microsoft.jet.Oledb.4.0; data source =" & Server.mappath ("testmb.mdb") Conn.open connStr%> 4. Establish a special string conversion requirement librar. Lib.asp The main role of this file is to make the ASP program that implements some functions to make a word program to facilitate calls. <% Dim topcodesub cntop () topcode = "current time is:" topcode = topcode & now () end subdim leftcode, isub cnleft () for i = 1 to 5 leftcode = leftcode & "

cnbruce.com" nextend subdim rightcodesub cnright ( ) For i = 1 to 9 rightcode = rightcode & "


<% sql = "select * from moban where m_id = 1" set = server .CreateObject ("AdoDb.Recordset") RS.Open SQL, CONN, 1, 1MB_CODE = RS ("m_html") rs.closset = NothingcNTop () MB_CODE = Replace (MB_CODE, "$ CNTOP $", TOPCODE) CNLT ( ) MB_CODE = Replace (MB_CODE, "$ CNLEFT $", LEFTCODE) CNRight () MB_CODE = Replace (MB_CODE, "$ CNRIGHT $", RightCode) response.write MB_CODE%> This page main function is to display template code, and Transforming the special code to the relative subroutine function. At this point, the template function of the ASP is basically completed, and the rest is: establish a program page with editing template feature, change the library file to the program functionality that you need .... Author cnbruce is transferred from Blueidea.com

转载请注明原文地址:https://www.9cbs.com/read-126148.html

New Post(0)
CopyRight © 2020 All Rights Reserved
Processed: 0.038, SQL: 9