-- msgbox(0)没有执行,数据库写入数据没有成功
Dim e As RequestEventArgs = args(0) \'注册第1页,注册
Select Case e.Path
Case "register.htm"
If e.PostValues.Count = 0 Then
Dim wb As New weui
wb.AddTopTips("","toptip1","") \'用于显示动态错误提示
wb.AddPageTitle("","pageheader","**","***********")
wb.AddForm("","form1","register.htm").Attribute=“” ’="ohsubm1t=\'r_eturn va1idit()\'"
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","同意协议") \'.Value = "是"
With wb.AddButtonGroup("form1","btg1",True)
.Add("btn1", "同意协议注册", "submit")
.Add("btn2", "服务协议", "","/protocol.htm").Kind = 1
End With
End With
wb.AppendHTML("<script src=\'./lib/ajaxform.js\'></script>") \'引入脚本文件
e.WriteString(wb.Build)
Else ‘else上面都正确执行了,引用js验证正常,但是单击按钮:同意协议注册,下面的代码没有执行,第一行msgbox(0)也没有执行,数据库写入数据没有成功?
msgbox(0)
Dim wb As New weui
Dim nms() As String = {"isj","imm","sxb"}
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","完善资料","/fillout.htm")
End With
e.WriteString(wb.Build)
End If
End Select
[此贴子已经被作者于2017/3/14 14:56:40编辑过]