请老师给看看,我下面的代码是要对数据进行编辑,但进入页面后:
1、输入不了,输入框无反应。
2、点击确定按钮后无反应。
Dim e As RequestEventArgs = args(0)
Dim wb As New weui
Dim PageNumber As Integer = e.GetValues("page")
Dim PrimaryKey As Integer = e.GetValues("key")
Dim PageURL = "jdlkList.htm?page=" & PageNumber
If e.PostValues.Count = 0 Then '生成编辑页面
Dim dr As DataRow = DataTables("学生数").SQLFind("[_Identify]=" & PrimaryKey)
If dr IsNot Nothing Then
wb.AddForm("","form1","edit.htm?key=" & PrimaryKey & "&page=" & PageNumber)
With wb.AddInputGroup("form1","ipg1","编辑学生信息")
With .AddInput("年级","年级","text")
.Value = dr("年级")
.Readonly= True
End With
With .AddInput("班级","班级","text")
.Value = dr("班级")
.Readonly= True
End With
With .AddInput("班主任","班主任","text")
.Value = dr("班主任")
.Readonly= True
End With
With .AddInput("年报人数","年报人数","number")
.Value = dr("年报人数")
.Min = "25"
.Max = "60"
.Value = dr("年报人数")
.Readonly= True
End With
With .AddInput("在校人数","在校人数","number")
.Min = "25"
.Max = "60"
.Value = dr("在校人数")
.Readonly= True
End With
With .AddInput("民族_汉族","汉族人数","number")
.Min = "1"
.Max = "50"
.Value = dr("民族_汉族")
.Readonly= True
End With
With .AddInput("民族_少数民族","少数民族","number")
.Min = "1"
.Max = "50"
.Value = dr("民族_少数民族")
.Readonly= True
End With
With .AddInput("性别_男","男生人数","number")
.Min = "1"
.Max = "50"
.Value = dr("性别_男")
.Readonly= True
End With
With .AddInput("性别_女","女生人数","number")
.Min = "1"
.Max = "50"
.Value = dr("性别_女")
.Readonly= True
End With
With .AddInput("住宿生_男","住宿男生数","number")
.Min = "1"
.Max = "50"
.Value = dr("住宿生_男")
.Readonly= True
End With
With .AddInput("住宿生_女","住宿女生数","number")
.Min = "1"
.Max = "50"
.Value = dr("住宿生_女")
.Readonly= True
End With
End With
With wb.AddButtonGroup("form1","btg1",True)
.Add("btn1", "确定", "submit")
End With
Else
With wb.AddMsgPage("","msgpage","编辑失败", "此信息可能已经被删除!") '提示
.icon= "Warn"
.AddButton("btn1","返回",PageURL) '生成返回原来页面的按钮
End With
End If
Else '保存编辑结果
Dim dr As DataRow = DataTables("学生数").SQLFind("[_Identify]=" & PrimaryKey)
If dr IsNot Nothing Then
Dim nms() As String = {"学生数","年级","班级","班主任","年报人数","在校人数","民族_汉族","民族_少数民族","性别_男","性别_女","住宿生_男","住宿生_女"}
For Each nm As String In nms
dr(nm) = e.PostValues(nm)
Next
dr.Save()
'显示完成提示,2妙手自动返回原来的页面
wb.AppendHtml("<meta http-equiv='refresh' c>",True)
wb.AddToast("","t1", "编辑完成",0).Visible = True
Else
With wb.AddMsgPage("","msgpage","保存失败", "此信息可能已经被删除!") '提示.
.icon= "Warn"
.AddButton("btn1","返回",PageURL) '生成返回原来页面的按钮
End With
End If
End If
e.WriteString(wb.Build) '生成网页