Dim e As RequestEventArgs = args(0)
Dim wb As New weui
Dim ph As String
Dim drk As DataRow
DataTables("起吊").DataRows(0).Load()
DataTables("StockGoods").Load
DataTables("货单").Load()
Dim bm As Integer
Dim bm1 As Integer
With DataTables("货单")
bm1 = .Compute("max(序列号)")
bm = .Compute("max(序列号)") +1
End With
drk = DataTables("起吊").DataRows(0)
If e.PostValues.Count = 0 And drk("起吊1") = "完成" Then
wb.AddForm("","form2","addnew.htm")
With wb.AddInputGroup("form2","ipg1","入库信息")
.AddInput("货名","货名","Text") '前一个是ID,后一个是标题
.AddInput("合同号","合同号","Text")
.AddHiddenValue("序列号",bm)
With.AddUploader("up1","照片",False) ' 表示允许上传1文件
.AllowDelete = True '允许删除
End With
End With
With wb.AddInputGroup("form2","ipg2","")
With .AddSelect("货位排行","货位排行","1|2|3|4|5|6|7|8|")
.Attribute = """
End With
.AddSelect("货位","货位","")
End With
With wb.AddButtonGroup("form2","btg1",True)
.Add("btn1", "确定", "submit")
End With
e.WriteString(wb.Build) '生成网页
Return ""
Else If e.PostValues.Count <> 0 And drk("起吊1") = "完成" And e.PostValues("序列号") > bm1 Then
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
Dim drb As DataRow
drb = DataTables("货单").addNew()
drb("操作") = "入库"
Dim nms1() As String = {"货名","合同号","货位"} '列名数组,注意列名和输入框必须一一对应,位置不能错乱
For Each nm1 As String In nms1
If e.PostValues.ContainsKey(nm1) Then
drb(nm1) = e.PostValues(nm1)
End If
Next
For Each key As String In e.Files.Keys
If key = "up1" Then
For Each fln As String In e.Files(key)
e.SaveFile(key, fln, ProjectPath & "Attachments\" & fln)
Next
drb.Lines("照片") = e.Files(key)
End If
Next
Dim drA As DataRow
drA = DataTables("起吊").DataRows(0) '引用第二行
drA("起吊1") = "起吊" '设置该行数量列的值
drA("序列号") = drb("序列号")
DataTables("起吊").Save()
DataTables("货单").Save() '用SQLAddNew增加的行,必须保存一下,否则会被丢弃.
wb.AddMsgPage("","msgpage","增加成功", " ") '生成成功提示页
e.WriteString(wb.Build)
e.PostValues.Clear '清除所有的键和值
Else If drK("起吊1")= "起吊" Then
Dim sb As New StringBuilder
With wb.AddMsgPage("","msgpage", "有没完成的任务,请等待!完成后再下单" ,"") '生成成功提示页
.Icon = "warn"
e.WriteString(wb.Build)
Return "" '必须返回
End With
e.WriteString(wb.Build)
Return "" '必须返回
End If
请问 用这个函数做的页面进入时经常出现 空白页 ,特别是刷新页面情况下出现空白 的概率最多。是什么问题