这是登录页面代码,原可以正常执行,有cookie情况下,增加自动输入手机号和密码功能
代码如下保存时,提示value不是boolean成员,错误代码:.Value = UserName
Dim e As RequestEventArgs = args(0) '登录页面
Dim wb As New weui
If e.PostValues.Count = 0 Then
wb.AddTopTips("","toptip1","") '用于显示动态错误提示
If e.Cookies.ContainsKey("isj")
wb.InsertHTML("<meta http-equiv='Re-fresh' con-tent='0; ur-l=/index.htm'>") '那么直接跳转到:首页
e.WriteString(wb.Build) '生成网页
Return "" '必须的
End If
Dim UserName As String = e.Cookies("isj") '从cookie中获取用户名
Dim Password As String = e.Cookies("imm") '从cookie中获取用户密码
With wb.AddArticle("","ar1")
.AddImage("./images/langwo/logo1.jpg")
.Attribute = "style='padding:0em;'"
End With
wb.AddForm("","form1","login.htm").Attri-bute = "on-submit = 're-turn validit_login()'" '改在/getVimg.htm验证,这里屏蔽掉
With wb.AddInputGroup("form1","ipg1","登录")
If e.PostValues.ContainsKey("isj") AndAlso e.PostValues.ContainsKey("imm") Then '判断是否是验证失败后的重新登录
wb.AddTopTips("","toptip1","用户名或密码错误!").msec = 2000 '如果用户通过登录按钮访问,则给用户一个2秒的提示.
End If
With .AddInputCell("ic1") '通过InputCell增加输入框(1表示突出显示,2表示红色警示图标)
.AddLabel("lsj","手机",0) '增加标签(0显示在左边)
If UserName <> "" Then '如果有用户名,则自动填写手机号
With .AddInput("isj","text",1).PlaceHolder= "请输入手机号" '增加输入框(0靠左显示,1居中显示,2靠右显示)
.Value = UserName
End With
Else '如果没有有用户名,则不填写
.AddInput("isj","text",1).PlaceHolder= "请输入手机号" '增加输入框(0靠左显示,1居中显示,2靠右显示)
End If
End With
With .AddInputCell("ic2")
.AddLabel("lmm","密码",0)
If UserName <> "" Then '如果有用户密码,则自动填写
With .AddInput("imm","password",1).PlaceHolder= "请输入密码" '增加输入框(0靠左显示,1居中显示,2靠右显示)
.Value = Password
End With
Else '如果没有有用户密码,则不填写
.AddInput("imm","password",1).PlaceHolder= "请输入密码"
End If
End With
With .AddInputCell("ic5") '通过InputCell增加输入框
.AddLabel("lyzm","验证码",0) '增加标签,0显示在左边
.AddInput("yzm","text",1) '增加输入框,1表示显示在中间
.AddImage("pim","/getVimg.htm?rand=1",2).Attribute ="on-click=""this.src = 'getVimg.htm?rand='+ + Math.random()""" '增加一个图片,2比表示显示在右边
End With
'.AddSwitch("jizhumima","记住密码").Value = "是" '此行已注释
With wb.AddButtonGroup("form1","btg1",True)
.Add("btn1", "登录","submit") '"/index.htm")
End With
With wb.AddButtonGroup("form1","btg2", False)
.Add("btn2", "免费注册","","/register.htm").Kind = 1
.Add("btn3", "忘记密码","","/getback.htm").Kind = 1
End With
End With
wb.AppendHTML("<script src='./lib/ajaxform_login.js'></script>") '引入脚本文件
e.WriteString(wb.Build) '生成网页
End If