请教老师,下面代码,第一次在浏览器打开页面增加内容,能正常在后台增加行和内容并保存,各页面都正常,
如果继续添加报名,填写内容,点击提交报名按钮,页面变成空白无任何提示后台也不会增加内容和新行,不知是哪里的问题,请老师帮忙看看
(以下代码Http开启,是在本机测试的IP http://*:80/)
Dim wb As New weui
Select Case e.Path
Case "addnew.htm","" '登录页面 默认网页加""
wb.AddPageTitle("","pageheader","DNTATS","欢迎您参加本次活动")
If e.PostValues.Count = 0 Then
wb.AddForm("","form1","addnew.htm")
With wb.AddInputGroup("form1","ipg1","本次活动报名进行中")
With .AddInput("主题","主题","text")
.Value = "工程企业管理实践"
.Readonly= True
End With
With .AddInput("副标","副标","text")
.Value = "管理管理"
.Readonly= True
End With
With .AddInput("活动时间","活动时间","text")
.Value = "2019年11月12日 19:00"
.Readonly= True
End With
End With
With wb.AddInputGroup("form1","ipg2","请填写报名信息")
.AddInput("工作单位","报名单位","text").Placeholder = "请输入单位名称"
.AddSelect("工作岗位","工作岗位","|高层管理|技术总工|中层管理|其他")
.AddInput("姓名","参加人员","text").Placeholder = "请输入姓名"
End With
With wb.AddButtonGroup("form1","btg1",True)
.Add("btn1", "提交报名", "submit") 'submit
End With
e.WriteString(wb.Build) '生成网页
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("btnn1","返回").Attribute = ""
End With
e.WriteString(wb.Build)
Return '必须返回
End If
Next
nms = New String() {"工作单位","姓名","工作岗位"}
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("btn2","完成退出","https://www.baidu.com/")
.AddButton("btn3","继续添加报名","addnew.htm/") 第一次填入内容,后台表增加行和内容没有问题,如果点击此按钮,继续添加内容后无法增加新行,页面是空白的
End With
e.WriteString(wb.Build)
End If
End Select