Dim fl As String = ProjectPath & "Attachments\" & e.path
If filesys.FileExists(fl)
Dim idx As Integer = fl.LastIndexOf(".")
Dim ext As String = fl.SubString(idx)
Select Case ext
Case ".jpg",".gif",".png",".bmp",".wmf",".js",".css" ,".html",".htm",".zip",".rar"
e.WriteFile(fl)
Return '这里必须返回
End Select
End If
Select Case e.Path
Case "addnew.htm"
Dim wb As New weui
wb.AddForm("","form1","test.htm")
With wb.AddInputGroup("form1","ipg1","动态列表")
.AddInput("单位","单位","text").Attribute= "onkeyup=""var result=submitAjaxFileds('getBrands.htm','','单位','电话',false); document.getElementById('p1').innerHTML=result;"""
wb.InsertHTML("<div id='p1'></div>") '插入一个div,用于显示服务器返回的数据
.AddInput("电话","电话","text")
End With
e.WriteString(wb.Build) '生成网页
Case "getBrands.htm"
If e.PostValues("单位") >"" Then
Dim sb As New StringBuilder
Dim nms() As String = {"单位","电话"}
sb.AppendLine("<Table style='width:100%;' >")
Dim drs As List(of DataRow) = DataTables("供应商表").SQLSelect(" 单位 like '%" & e.PostValues("单位") & "%' ")
For Each dr As DataRow In drs
sb.Append("<tr style='height:30px; style='border-bottom:1px solid #F5F5F6;width:80%;' >")
sb.Append("<td style='width:80%;text-indent:4em;color:#7777CC;font-size:20px' onclick=""document.getElementById('电话').value='" & dr("电话") & "'"" >" & dr("单位") & "|" & dr("电话") & "</td>")
sb.AppendLine("</tr></br>")
Next
sb.AppendLine("</Table></br> ")
e.WriteString(sb.ToString)
End If
End Select