要做一个投票的网站,需要先登录才能投票,且每个人最多能投一次票,现在找到了一个网站模板,但没有登陆的要求,怎么修改呢,希望大家多多指点,
IIS+access+ASP 真诚感谢。
IIS+access+ASP 真诚感谢。
解决方案 »
- reflector的使用问题,求高手!
- urlwriter 转发的问题
- 如何点击一按钮/链接让页面定位在指定的位置?(新手)
- 谁知道哪儿有把变量写进数据的语法教程啊?
- 两个消息队列的解决方案:MSMQ 和ServiceBroker 我应该选择哪个呢?
- 在.net技术下增加asp.net2005专题
- dropdownlist控制checkboxlist和radiobuttonlist的问题
- 招.Net C#程序员(广州)
- 如何在服务器端创建access 数据库,并将文件(mdb)保存到磁盘?
- 如何在asp.net 中作session的timeout认证
- asp.net输入问题
- 请教一个wcf问题
要不然就不会这么问
if session("username")="" then
response.redirect("login.asp")
end if
在用户提交投票时先根据Session中的存储的用户ID来从数据库中的投票记录表中判断是否存在记录。
如存在说明已投过票,提示“您已参与过投票”。
如不存在,则提交投票记录即可
可以用cookie实现
用户登录就在用户电脑上写入一个登陆的cookie
保存用户登录信息
用户投票的时候判断cookie中的值,
如果没有跳转到登录页面
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>WAMR登录系统</title><script type="text/javascript" language="JavaScript">
//禁止浏览器后退方法
javascript:window.history.forward(1);</script><%-- <script type="text/javascript" src="ymPrompt.js"></script>
--%>
<meta http-equiv="Expries" content="0" />
<meta http-equiv="Cache-Control" content="no-cache" />
<meta http-equiv="Pragma" content="no-cache" />
<style type="text/css">
.styleDiv
{
height: 100%;
border: 0px 0px 0px 0px;
}
.styleLeft
{
width: 70%;
text-align: left;
height: 100%;
}
.tdStyle
{
text-align: center;
width: 30px;
height: 28px;
}
.lableStyle
{
text-align: center;
}
.lblFont
{
font-size: 15pt;
color: #191970;
}
.lblFont1
{
font-size: 13pt;
color: #7B68EE;
}
.style2
{
text-align: center;
width: 85px;
height: 28px;
}
.imgStyle
{
border-bottom: 0px;
border-right: 0px;
border-left: 0px;
border-top: 0px;
}
.style3
{
width: 85px;
text-align: center;
}
.btnStyle
{
text-align: center;
background-color: #E6E6FA;
font-size: 13pt;
}
.btn-tdStyle
{
width: 60%;
}
.a_font
{
font-size: 11pt;
color: #7B68EE;
text-align: center;
}
.a_font1
{
font-size: 9pt;
}
</style>
</head>
<body>
<form id="form1" runat="server">
<div class="styleDiv">
<img alt="" src="image/top.jpg" style="width: 100%; height: 41px; margin-left: 4px;" />
<span>
<img alt="" src="image/WAMR.jpg" style="height: 36px" /></span><a class="lblFont"> 你要的登录界面介绍 </a>
<table class="styleDiv">
<tr>
<td class="styleLeft">
<img alt="登录图片" src="image/登录.jpg" style="width: 100%" />
</td>
<td>
<img alt="" src="image/logintop.jpg" style="width: 100%" />
<table>
<tr>
<td class="style3">
<asp:Label ID="lblUserName" runat="server" CssClass="lblFont1" Text="用户名:"></asp:Label>
</td>
<td>
<asp:TextBox ID="txtUserName" runat="server"></asp:TextBox>
</td>
</tr>
<tr>
<td class="style2">
<asp:Label ID="lblPassWord" runat="server" CssClass="lblFont1" Text="密 码:"></asp:Label>
</td>
<td>
<asp:TextBox ID="txtPassWord" runat="server" TextMode="Password"></asp:TextBox>
</td>
</tr>
</table>
<table>
<tr>
<td class="btn-tdStyle">
</td>
<td>
<asp:Button ID="btnLogin" runat="server" CssClass="btnStyle" Text="登 录" OnClick="btnLogin_Click" />
</td>
</tr>
</table>
</td>
</tr>
</table>
</div>
</form>
</body>
</html>然后自己再添加相应的事件代码