Recommended: parse ASP and stored procedures There are many articles on ASP and Stored Procedures, but I doubt that the authors have actually practiced it. I read a lot of relevant information when I was in the beginning and found that many of the methods provided were not the case in practice. For simple applications, this
Tree directory display program
Problem description:
In our projects, self-associated data tables often appear. If we look at them from the overall perspective, the entire table is presented as a tree data structure (for complex cases, it may become a graph). When we display and edit this table, it will appear clumsy if we do not use good expressions. For this reason, we develop such a tree structure program. In the previous version, we used a recursive algorithm to implement it. When we evaluated this algorithm, we found that we were no longer competent for databases with thousands of records. Therefore, in the new algorithm version, we used XML technology to dynamically discover data to solve the embarrassment of large amounts of data from the server at one time, and at the same time, we also avoided the error of entering a dead loop if the table data structure is presented as a graph.
Practical ideas:
1. Only the root and secondary nodes are displayed during initial display, and the root and secondary nodes are at the same level.
2. Click on a node. If its child node area object does not exist, create the object, download the data and update the data at the same time, display all child nodes.
3. Each node has the same function after it is established, such as checking whether the child node exists, showing hidden child nodes, etc.
4. DHTML XML ASP CSS is used simultaneously
Technical Difficulties:
1. Garbage code problem when using XMLhttp interface:
Because in the ASP output page, the default encoding scheme is not in Chinese, when interpreted in XMLhttp of the client page, the default scheme will be parsed, so garbled will appear. To this end, we add the following code to define the encoding scheme in the ASP page on the Server side:
Response.CharSet=GB2312
Response.ContentType=text/HTML
2. How to maintain the style of the previous version on the interface (class explorer form):
In the previous version, all page content was completed in one go, and the control ideas were adopted, and the interface was relatively friendly at all times. At that time, the mechanism in this version changed, and the content was a key issue for multiple synthesis. How to determine the id of the img and span object has been verified. On the interface, the interface of this version is difficult to be the same as the first interface, so only part of it can be retained, but overall, the new interface can also meet the needs.
Because it is difficult to use attachments here, I can only paste the source code:
| The following is the quoted content: ---xtree.HTML------------------------------------------------------------------- <HTML> <HEAD> <META NAME=GENERATOR Content=Microsoft Visual Studio 6.0> <SCRIPT LANGUAGE=javascript src=../../xtree.js> </SCRIPT> <style type=text/CSS> <!-- a:link { font-size: 14px; text-decoration: none; color: #0000FF} a:visited { font-size: 14px; color: #0000FF; text-decoration: none} a:hover { font-size: 14px; color: #FF0000; background-color: #CCCC99; text-decoration: none} a:active { font-size: 14px; color: #FFFFF; background-color: #191970; text-decoration: none} .item{ font-size:14px} --> </style> </HEAD> <BODY leftMargin=0 rightMargin=0 topMargin=0 border=0> <bold>Tree Menu Demonstration Program</bold><br> <table border=0> <tr><td nowrap> <span id='oSpanroot' border=0></span><SCRIPT LANGUAGE=javascript>createChildNode(root,0);</SCRIPT></td></tr> </table> </BODY> </HTML> -------xtree.ASP--------------------------------------------------------------- <%@ Language=VBScript %> <% Response.CharSet=GB2312 |
Share: Analyze the commonly used server detection source code in ASP Commonly used detection codes when writing ASP web pages: Server Current time: Reference % =now %>Server CPU model: Reference %=Request.ServerVariables(HTTP_UA_CPU)%>Current resolution: Reference &l
3 pages in total Previous page 123 Next page