说明: 在编译向该请求提供服务所需资源的过程中出现错误。请检查下列特定错误详细信息并适当地修改源代码。
编译器错误信息: BC30684: “dbnull”是一个类型,不能用作表达式。
源错误:
行 27: <script language="vb" runat="server">
行 28: sub page_load(sender as object,e as eventargs)
行 29: if request.Cookies.item("MyWeb_UserId"=dbnull :confused
r
行 30: request.Cookies.item("myweb_userid"
.value="" then
行 31: pan2.visible=false
<html>
<asp
anel id="pan1" runat="server">
<form runat="server">
<table>
<tr><td>帐号:</td>
<td><asp:textbox ID="txtid" runat="server"/>
</td>
</tr>
<tr>
<td>密码:
</td>
<td><asp:textbox textmode="password" id="txtpassword" runat="server"/>
</td>
</tr>
</table>
<asp:button ID="btnsubmit" Text="确定" onClick="btnsubmit_click" runat="server"/>
<asp:button ID="btnreset" Text="清除" onClick="btnreset_click" runat="server"/>
<asp:label ID="label1" Text="请输入帐号和密码" runat="server"/>
</form>
</asp
anel>
<asp
anel ID="pan2" runat="server">
HI!<asp:label ID="lblmsg" runat="server"/>,欢迎光临
</asp
anel>
<script language="vb" runat="server">
sub page_load(sender as object,e as eventargs)
if request.Cookies.item("MyWeb_UserId"
=dbnull or
request.Cookies.item("myweb_userid"
.value="" then
pan2.visible=false
else
response.Cookies.item("myweb_userid"
.expires=now.addmonths(1)
lblmsg.text=request.Cookies.item("myweb_userid"
.value
pan1.visible=false
end if
end sub
sub btnsubmit_click(sender as object, e as eventargs)
if txtid.text="asp" and txtpassword.text="dotnet" then
response.Cookies("myweb_userid"
.value=txtid.text
response.cookies.item("myweb_userid"
.expires=now.addmonths(1)
pan1.visible="false"
pan2.visible="true"
lblmsg.text=txtid.text
end if
end sub
sub btnreset_click(sender as object, e as eventargs)
txtid.text=""
txtpassword.text=""
end sub
</script>
</html>