Dim e As RequestEventArgs = args(0) \'注册第1页,注册
Select Case e.Path
Case "register.htm"
Dim wb As New weui
If e.PostValues.Count = 0 Then
wb.AddPageTitle("","pageheader","hh网","2222222222护航")
wb.AddForm("","form1","register.htm")
With wb.AddInputGroup("form1","ipg1","快速注册")
With .AddInputCell("ic1") \'通过InputCell增加输入框(1表示突出显示,2表示红色警示图标)
.AddLabel("lsj","手机",0) \'增加标签(0显示在左边)
.AddInput("isj","text",1).PlaceHolder= "请输入手机号" \'增加输入框(0靠左显示,1居中显示,2靠右显示)
End With
With .AddInputCell("ic2")
.AddLabel("lyz","验证",0)
.AddInput("iyz","text",1).PlaceHolder= "请输入验证码"
.AddVcodeButton("vyz","获取验证码",2) \'0靠左显示,1居中显示,2靠右显示
End With
With .AddInputCell("ic3")
.AddLabel("lmm","密码",0)
.AddInput("imm","text",1).PlaceHolder= "请输入密码"
End With
.AddSelect("sxb","性别","|男|女")
.AddSwitch("fuwuxieyi","同意协议")
With wb.AddButtonGroup("form1","btg1",True)
.Add("btn1", "注册", "","http://127.0.0.1/fillout.htm")
.Add("btn1", "查看服务协议", "","http://127.0.0.1/fillout.htm").Kind = 1
End With
End With
Else
Dim nms() As String = {"手机","密码","性别","同意协议"} \'不能为空的列名数组
For Each nm As String In nms
If e.PostValues.ContainsKey(nm) = False Then \'生成错误提示页
With wb.AddMsgPage("","msgpage","增加失败", nm & "列不能为空!")
.icon = "Warn" \'改变图标
.AddButton("btn1","返回").Attribute = ""
End With
e.WriteString(wb.Build)
Return "" \'必须返回
End If
Next
nms = New String() {"手机","密码","性别","同意协议"} \'重新定义了nms数组,增加了两列.
Dim dr As DataRow = DataTables("会员资料").AddNew()
For Each nm As String In nms
If e.PostValues.ContainsKey(nm) Then
dr(nm) = e.PostValues(nm)
End If
Next
\'保存并生成增加成功提示页面
dr.save()
With wb.AddMsgPage("","msgpage","增加成功", "好好学习,天天向上") \'生成成功提示页
.AddButton("btn1","继续增加","addnew.htm")
End With
End If
e.WriteString(wb.Build)
End Select