以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  为什么在httprequest会请求2次?  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=142255)

--  作者:z769036165
--  发布时间:2019/10/22 10:27:00
--  为什么在httprequest会请求2次?
Dim e As RequestEventArgs = args(0)
Sele ct Case e.Path
    Case "rz.htm"
        Dim wb As New WeUI
        wb.AddToast("","t1", "正在下载",1) \'定义提示
        wb.AddForm("","form1","rz.htm")
        With wb.AddInputGroup("form1","ipg1","日期输入")
            .AddInput("nl","日期选择","date").Value = Date.Today.AddDays(-1)
        End With
        With wb.AddButtonGroup("form1","btg1",False)
            .Add("btn4", "查询","button")
            .Add("btn5", "excel下载", "", "http://127.0.0.1/rzxiazai.htm").attrib ute= "on click=""s how(\'t1\',5000)""" 
        End With  
        With wb.AddTable("","Table1")
            .CreateFromDataTable(DataTables("汇总"),True)
        End With
        wb.Append HTML("<script src=\'./lib/ribcx.j s\'></script>")
        e.Write String(wb.Build)
    Case "rzxiazai.htm"
        Dim fl As String = ProjectPath & "Reports\\汇总" & DataTables("汇总").DataRows(0)("日期") & ".xls"
        Functi ons.Execute("excel生成")  \'处理生成excel + 调整为自动行高
        Dim Book As New XLS.Book(fl)
        book.PreBuild = False
        e.WriteBook(book,"汇总",False)
End Sele ct

在httprequest执行
Functions.Execute("汇总",e)

但是出来的界面,点击下载后,发现httprequest中Functions.Execute("汇总",e)执行了2次,excel生成和调整行高速度慢,处理2次更慢了,这个地方是怎么会执行2次了呢?

--  作者:有点蓝
--  发布时间:2019/10/22 10:37:00
--  
httprequest所有代码发上来看看
--  作者:z769036165
--  发布时间:2019/10/22 10:49:00
--  
完整代码:
Se lect Case e.path
    Case "rz.htm","rz1.htm","rzxiazai.htm"
MessageBox.Show(e.Path)
        Functions.Execute("汇总",e)
    Case Else
        e.WriteString("这是个空白内容!")
End Se lect

发现弹出2次rzxiazai.htm

--  作者:有点蓝
--  发布时间:2019/10/22 11:17:00
--  
我测试没有问题。实例发上来测试一下