Skip to content

Instantly share code, notes, and snippets.

@gregperes
Last active August 29, 2015 14:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gregperes/cfea75c1762006738803 to your computer and use it in GitHub Desktop.
Save gregperes/cfea75c1762006738803 to your computer and use it in GitHub Desktop.
Palestra Arquitetura Web Desacoplada
<%
Dim cn = "ConnectionString"
Set conn = Server.CreateObject("ADODB.Connection")
conn.Open cn
Dim query = "SELECT * FROM todos ORDER BY created_at DESC"
Set rs = Server.CreateObject("ADODB.RecordSet")
rs.Open sql, conn
%>
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>ASP Sample</title>
<script type="text/javascript">
document.body.onload = function () {
document.getElementByTagName("checkbox").onclick = function () {
alert("Yeah! Just complete a todo :)");
};
};
</script>
</head>
<body>
<ul>
<%
Do While Not rs.EOF
%>
<li>
<input type="checkbox" name="todo-<%=rs.Fields("id")%>" value="<%=rs.Fields("id")%>">
<%=rs.Fields("description")%>
</li>
<%
objRS.MoveNext()
Loop
%>
</ul>
</body>
</html>
<%
Set rs = Nothing
Set conn = Nothing
%>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment