Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Execute 를 할때 값을 전달할수 없는지요?

230 views
Skip to first unread message

DEW

unread,
Sep 30, 2003, 2:47:33 AM9/30/03
to
Execute 를 할때 값을 전달할수 없을까요?
Execute?a=111 이런 형태로 작압을 해야 하는데
안되네요..


Microsoft Developer Support

unread,
Sep 30, 2003, 2:52:54 AM9/30/03
to
Server.Execute 시 Parameter 를 넘길 수 없는 문제에 관련된 답변 입니다.
이 문제는 다음 자료를 참고 하시면 알 수 있듯이 Server.Execute 에는 Pram 값을
넘길 수 없습니다.

Using a Query String in the IIS Server.Execute Parameter Produces an Error
http://support.microsoft.com/default.aspx?scid=kb;en-us;q247420

이에 대한 해결 방안으로는

1. Application variables, even if they are set in the calling page.
2. Session properties, even if they are set in the calling page.
3. Server variables and properties, even if they are set in the calling
page.
4. Request collections and properties, even if they are set in the calling
page. This includes Form and QueryString data passed to the calling page.
5. Response collections and properties. The executed .asp file may modify
HTTP headers. However, as with any .asp file, if the executed .asp file
attempts to modify HTTP headers after it sends a response to the client, it
will generate an error.

일단 위의 MSDN 발췌 내용이 참고가 되리라 생각 됩니다.
직접 값을 전달해 줄 수는 없으나
VB의 전역변수 처럼 이용 할 수 있는 session 이나 값이 유지되어 넘어가는 HTTP
headers 를 이용 한다면
꽁수 처럼 비슷하게 기능 구현이 가능하리라 생각 되지만
사실 그렇게 훌륭한 방법은 아니라고 생각 됩니다.

다음은 간단한 Sample 입니다.


++++++++++++++++++++++++++++++++++++++++++++++++++++++++
[start.html]
++++++++++++++++++++++++++++++++++++++++++++++++++++++++

<%@ Language=VBScript %>
<HTML>
<HEAD>
<META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
</HEAD>
<BODY>

<a href=execute_01.asp?aaa=111>눌러주세효</a>


</BODY>
</HTML>


++++++++++++++++++++++++++++++++++++++++++++++++++++++++
[execute_01.asp]
++++++++++++++++++++++++++++++++++++++++++++++++++++++++

<%@ Language=VBScript %>
<HTML>
<HEAD>
<META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">

<script language=vbscript>


</script>
</HEAD>
<BODY>

<%
Response.Write Request("aaa") & "<br>"

for i = 1 to 10

if i = 5 then
server.execute "execute_02.asp"
end if

Response.Write i & "<br>"


next


%>

</BODY>
</HTML>

++++++++++++++++++++++++++++++++++++++++++++++++++++++++
[execute_02.asp]
++++++++++++++++++++++++++++++++++++++++++++++++++++++++

<%@ Language=VBScript %>
<HTML>
<HEAD>
<META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
</HEAD>
<BODY>

<%

Response.Write request("aaa") & "<br>"
%>

</BODY>
</HTML>

"DEW" <dew...@hotmail.com> wrote in message
news:OsiFC7xh...@tk2msftngp13.phx.gbl...

내야

unread,
Sep 30, 2003, 3:13:30 AM9/30/03
to
0 new messages