mi pesti se ti mando questo in asp?
codice:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
<title>Pagina senza titolo</title>
<script language="javascript" type="text/javascript">
// <!CDATA[
function invia_dati()
{
submitData("a.asp", {nome:'Pietro', numero:'999', data:'15/3/2005'} );
}
//-------------------------------------------------------------------------------------
// crea un form e fa submit passando dati POST
// utilizzo:
// w = window.open("", "popup", "left=100px, top=100px, width=500px, height=400px,");
// w.focus();
// submitData("a.aspx", {nome:'Pietro', numero:'999', data:'15/3/1780'} , "popup");
//-------------------------------------------------------------------------------------
function submitData(url, data, target)
{
var form = document.createElement("form");
form.action = url;
form.target = (target != undefined)? target: "_self";
form.method = "post";
form.style.display = "none";
for(var key in data) addParam(form, key, data[key]);
document.body.appendChild(form);
form.submit();
document.body.removeChild(form);
}
//----------------------------------------------
// aggiunge hidden ad un form
//----------------------------------------------
function addParam(form, key, value)
{
if( typeof(form) == "string")
form = document.getElementById(form);
var input = document.createElement("input");
input.type = "hidden";
input.name = key;
input.value = value;
form.appendChild(input);
}
// ]]>
</script>
</head>
<body>
invia dati
<% ScriviParametriForm %>
</body>
</html>
<%
'--------------------------------------------------------------
'scrive i parametri passati come post
'--------------------------------------------------------------
sub ScriviParametriForm
dim f
if Request.Form.Count > 0 then
Response.Write "<span style='FONT-FAMILY: Verdana, Arial;FONT-STYLE: normal;FONT-WEIGHT: bolder;COLOR: BROWN;FONT-SIZE: 8pt;BACKGROUND-COLOR: white;'>Parametri Form</span>"
Response.Write "<table BORDER=1 CELLSPACING=0 CELLPADDING=0 bordercolor='#000000' style='FONT-FAMILY: Verdana, Arial;FONT-STYLE: normal;COLOR: #000000;FONT-SIZE: 10pt;BORDER: black thin none;background:beige;width:0;'>"
for each f in Request.Form
Response.Write "<tr><td style='PADDING-LEFT:5px;PADDING-RIGHT: 5px;PADDING-TOP: 2px;PADDING-BOTTOM: 2px;'>" & f & "</td>" & "<td style='PADDING-LEFT:5px;PADDING-RIGHT: 5px;PADDING-TOP: 2px;PADDING-BOTTOM: 2px;'>" & NullToSpace(Request.Form(f)) & "</td></tr>"
next
Response.Write "</table>"
end if
end sub
'--------------------------------------------------------------
'converte NULL in spazio codificato
'--------------------------------------------------------------
function NullToSpace(v)
if isNull(v) then
NullToSpace = ""
else
if v = "" then
NullToSpace = ""
else
NullToSpace = server.HTMLEncode( v )
end if
end if
end function
%>