Dreamweaver MX tips and tricks
Author:Eve Cole
Update Time:2009-05-31 21:06:41
We have talked about some basic operations of DWMX before. I believe everyone will find it relatively simple after reading it. Indeed, this is a tool software, and its purpose should be easy to operate. In fact, the most basic thing about the network backend is to capture the database. Only by mastering this aspect can you learn more deeply. Of course, we have only learned a very small part of DWMX. There are still many behaviors (Server Behaviors) that you have to explore slowly by yourself. All we can do is take you into the world of MX and master deeper things. , it depends on your patience and will. Learning is happy, but it is also painful, especially when you encounter a problem and have no way to solve it.
Starting today, we are going to discuss some skills together. Our skills are not in operation, but in background applications, that is, ASP skills. MX can automatically generate code. I believe everyone already thinks it is a big leap, especially for designers, it is no longer out of reach. But everything has its negatives, and DWMX is no exception.
First of all: he generates too much code, which is not easy for beginners to understand. Many times we can replace the code it automatically generates with less code. Secondly: There are too many pages that it needs to manage, which means it brings a lot of trouble to web maintenance personnel. We can often see an after **** go to in the behavior dialog box, which means that we can After completing this operation, jump (tip: jump can also be said to be directed, the asp code is: Response.Redircet "newpage.asp") to a new page. In fact, it can be done on one page. The advantage of this is that we have fewer pages to maintain. Don’t underestimate it. If you can master this skill well, you will be able to build 30% fewer pages. , it is indeed the case, don’t be surprised.
Today we will talk about the skills in this area: here we mainly use an if...endif statement. I think everyone understands this. How to implement it specifically?
For example: We want to build a login system and use traditional DWMX to do it. We need two pages. This is a very simple thing, only a few lines of code? So I decided to combine them on one page.
Programming ideas: If we want to build a login system, we must use forms When submitting a form, we use Request.form("name") to get the value in the form. Another way to transfer information between the client and the server is Request.QueryString, which is passed together with the url. This is what we often see, http://www.cfsky.com/forum.asp?id=1. Id=1 is QueryString, we can use Request.queryString("id") to get its value.
What we want to achieve is to use an if statement to check whether there is a Querystring. If not, generate a form on the page. If there is, output "Welcome, City Lover" on the page (tip: Use Response.write "You want to output "The text" can be output, or you can use <%= "the text you want to output" %>)
Create a basic form on the page, named login.asp. Please note: we