vote.aspx
来自「asp做的新闻系统」· ASPX 代码 · 共 54 行
ASPX
54 行
<%@ import namespace="system.data"%>
<%@import namespace="system.data.oledb"%>
<%@ Page Language="vb" debug=true %>
<script runat=server>
sub page_load(sender as object,e as CommandEventArgs)
end sub
sub voteThis(sender as object,e as commandeventargs)
dim voteds as dataset =new dataset()
voteds.ReadXml(Server.MapPath("db\vote.xml"))
voteds.tables(0).rows(0).item(0)+=1
select case radio1.selecteditem.value
case "1"
voteds.tables(0).rows(0).item(1)+=1
case "2"
voteds.tables(0).rows(0).item(2)+=1
case "3"
voteds.tables(0).rows(0).item(3)+=1
case "4"
voteds.tables(0).rows(0).item(4)+=1
end select
voteds.writexml((Server.MapPath("db\vote.xml")))
votelabel.style("color")="red"
votelabel.text="投票成功!"
end sub
</script>
<form runat=server>
<asp:Panel ID=pa Runat=server>
<span align=center style="font-size:9pt" nowarp>您觉得这个站点怎么样?</span>
<asp:RadioButtonList Runat=server ID=radio1 style="font-size:9pt">
<asp:ListItem Value ="1" selected>很好</asp:ListItem>
<asp:ListItem Value ="2">好</asp:ListItem>
<asp:ListItem Value="3">一般</asp:ListItem>
<asp:ListItem Value="4">差</asp:ListItem>
</asp:RadioButtonList>
<table cellpadding=0 cellspacing=0>
<tr><td>
<asp:Button ID=button1 Runat=server
style="font-size:9pt"
CausesValidation=false
text="投票"
CommandName="vote"
OnCommand="voteThis" />
<Button ID="Button2" Runat=server
style="font-size:9pt"
ONCLICK="window.open('view_vote.aspx','_blank','left=10,
top=20,width=300,height=300')">查看</Button>
<asp:label id=votelabel runat=server style="font-size:9pt"/>
</td></tr></table>
</asp:Panel>
</form>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?