用upload上传照片,出现“增加成功”提醒(图一),如果点击浏览器刷新按钮就会重新写入数据(图二),如何杜绝刷新重新写入数据呢?
此主题相关图片如下:微信截图_20210809094159.png
此主题相关图片如下:微信截图_20210809094236.png
Dim nms() As String = {"标题","性别"}
Dim dr As DataRow = DataTables("员工").AddNew()
For Each nm As String In nms
dr(nm) = e.PostValues(nm)
Next
For Each key As String In e.Files.Keys
If key = "up1" Then
Dim lst As List(of String) = dr.Lines("照片")
For Each fln As String In e.Files(key)
Dim n As String = Format(Date.Now,"yyyyMMddHHmmssffff") & fln
e.SaveFile(key, fln, ProjectPath & "Attachments\" & n)
lst.Add(n)
Next
dr.Lines("照片") = lst
End If
Next '保存并生成增加成功提示页面
dr.save()
With wb.AddMsgPage("","msgpage","增加成功", "好好学习,天天向上") '生成成功提示页
.AddButton("btn1","继续增加","diaryadd.htm")
End With
e.WriteString(wb.Build)
[此贴子已经被作者于2021/8/9 9:47:28编辑过]