1. 첫번째로는 일반적으로 많이 쓰이는 형태(페이지를 삽입한다.)
<!-- #include file = "../include/common.asp" //--> <-- 상대경로
<!-- #include virtual = "/include/common.asp" //--> <-- 절대경로
2. 두번째로는 쓰이는 형태(페이지를 실행시킨다)
Server.Execute("test.asp") 과 같은형태로 사용합니다 (절대경로/상대경로)
3. 차이점
#include 참조받는 페이지와 변수를 같이 쓸수있다.
Server.Exe... 참조받는 페이지와 변수를 같이쓸수없다.
4. 만약 Server.Exe에서 참조받는페이지의 변수를 써야한다면 Server.Execute(Test.asp?Name="전성균")이런식으로 파라메터로 넘겨줘야한다.
장점/단점
#include 말그대로 변수를 같이 쓸수있어서 코딩이 용이하다/상황에따라 페이지 변경할수없다.
Server.Execute 코딩이 용이하지않다/상황에 따라 페이지변경이 가능하다.
EX) if (strURL = "1")Then
resultUrl = "test1.asp"
else
resultUrl = "test2.asp"
end if
Server.Execute(resultUrl)
댓글 없음:
댓글 쓰기