I have a asp.net website which calculates average and standard deviation using custom timestamps query in the code behind and store results in excel file. But whenever I click to select the longer timeframe it shoots this error. Code behind is as follows :-
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
Are there any changes required from the IIS point of view?
I have also added the following tag in the Web.config file but it is giving me the same error.
<system.webServer>
<modules runAllManagedModulesForAllRequests="true"/>
</system.webServer>