<!DOCTYPE html>
<html>
<body>
<%
response.write(“Hello World!”)
%>
</body>
</html>
Output : Hello World
2.Membuat Variable
<!DOCTYPE html>
<html>
<body>
<%
dim name
name=”Donald Duck”
response.write(“My name is: ” & name)
%>
</body>
</html>
Output: My name is: Donald Duck
3.Berinteraksi dengan user dalam bentuk Radio Button.
<!DOCTYPE html>
<html>
<%
dim cars
cars=Request.Form(“cars”)
%>
<body>
<form action=”demo_radiob.asp” method=”post”>
<p>Please select your favorite car:</p>
<input type=”radio” name=”cars”
<%if cars=”Volvo” then Response.Write(“checked”)%>
value=”Volvo”>Volvo</input>
<br>
<input type=”radio” name=”cars”
<%if cars=”Saab” then Response.Write(“checked”)%>
value=”Saab”>Saab</input>
<br>
<input type=”radio” name=”cars”
<%if cars=”BMW” then Response.Write(“checked”)%>
value=”BMW”>BMW</input>
<br><br>
<input type=”submit” value=”Submit” />
</form>
<%
if cars<>”" then
Response.Write(“<p>Your favorite car is: ” & cars & “</p>”)
end if
%>
</body>
</html>
Output :
Sumber : http://blog.uad.ac.id/muhisa/2013/05/21/contoh-program-asp/
0 comments:
Post a Comment