Click here to Skip to main content
15,921,837 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
When I click on the "show" button, it is not displaying the value of "a"(given in asp sub procedure)in the table.
I want that when I click on the "show" button then the value of "a" given in asp must be displayed in the table.

XML
<html>
<head>
<title>Opinion Poll
</title>
</head>
<body>
<h1 align=center>Opinion Poll</h1><br>
Exam should be conduct for each class :
<form method=post name=frm>
YES<input type=radio name=poll value="1">
NO<input type=radio name=poll value="2">
CAN'T SAY<input type=radio name=poll value="3">
<br>
<input type=submit value=SUBMIT name=sub>
<%
set counter1=server.createobject("mswc.counters")
%>
<%
dim op
op=request.form("poll")
if(op="1")then
counter1.increment("y")
elseif(op="2")then
counter1.increment("n")
elseif(op="3")then
counter1.increment("c")
end if
%>
<table border=1 align=center>
<caption>VOTER'S TALLY</caption>
<tr><td>yes<td>
<%
sub on_event()
a=counter1.get("y")
response.write a
end sub
%>

<tr><td>no<td>
<%
=counter1.get("n") %>

<tr><td>can't say<td>
<%
=counter1.get("c") %>

</table>
<br>
<center><input type=reset value=clear>&nbsp;&nbsp
<input type=button value=show onclick="<% on_event() %>">
</center>
</form>
</body>
</html>
Posted
Updated 31-Mar-11 5:17am
v3

1 solution

If this is classic asp code then you cannot call a server side method. you need to submit the form and then display the data based on the condition.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900