ASP ベーシック


  入力に Scripting.Dictionary を利用する



  
不可	Request.QueryString("In1001") = "データ"
不可	Request.Form("In1001") = "データ"
  

QueryString や Form にはデータを代入できないので、ディクショナリオブジェクトを使用します

  
<%
Set MyData = Server.CreateObject("Scripting.Dictionary")
if Request.QueryString.Count <> 0 then
	For Each strKey in Request.QueryString
		MyData( strKey ) = Request.QueryString( strKey )
	Next
end if
if Request.Form.Count <> 0 then
	For Each strKey in Request.Form
		MyData( strKey ) = Request.Form( strKey )
	Next
end if
%>

<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=Shift_JIS">
</HEAD>
<BODY>
<FORM method="POST">
	<INPUT
		type=text
		name=In1001 
		value="<%= MyData("In1001") %>"
	>
	<INPUT
		type=text
		name=In1002 
		value="<%= MyData("In1002") %>"
	>
	<INPUT type=submit value="送信">
</FORM>

<PRE>
<%
	For Each strKey in MyData
		Response.Write strKey & " -> "
		Response.Write MyData( strKey ) & vbCrLf
	Next
%>
</PRE>

</BODY>
</HTML>
  










  infoboard   管理者用   
このエントリーをはてなブックマークに追加





フリーフォントWEBサービス
SQLの窓WEBサービス

SQLの窓フリーソフト

素材

一般WEBツールリンク

SQLの窓

フリーソフト

JSライブラリ