我有一个asp.net网站,它使用后面的代码中的自定义时间戳查询来计算平均值和标准差,并将结果存储在excel文件中。但每当我点击选择较长的时间帧时,它就会发出此错误。背后的代码如下: -
Protected Sub Button4_Click(ByVal sender As Object, ByVal e As EventArgs) Handles Button4.Click
Response.Clear()
Response.AddHeader("content-disposition", "attachment;filename=FileName.xls")
Response.Charset = ""
Response.ContentType = "application/vnd.xls"
Dim stringWrite As New System.IO.StringWriter()
Dim htmlWrite As System.Web.UI.HtmlTextWriter = New HtmlTextWriter(stringWrite)
GridView6.RenderControl(htmlWrite)
Response.Write(stringWrite.ToString())
Response.[End]()
End Sub
从IIS的角度来看,是否需要进行任何更改?
我还在Web.config文件中添加了以下标记,但它给了我同样的错误。
<system.webServer>
<modules runAllManagedModulesForAllRequests="true"/>
</system.webServer>
答案 0 :(得分:0)
在web.config文件中添加了以下行
<configuration>
<system.webServer>
<security>
<requestFiltering>
<requestLimits maxAllowedContentLength="104857600" />
</requestFiltering>
</security>
</system.webServer>
</configuration>