albert albert

albert albert

  • NA
  • 524
  • 0

Response.clear

Dec 5 2013 3:17 AM
Hi everybody,

I have this:
[code]
  If ds.Tables.Count > 0 AndAlso ds.Tables(0).Rows.Count > 0 Then
                 lblMessage.Text = "Er zijn geen resultaten gevonden."
            lblMessage.Text = String.Empty
            Dim fc As Byte() = csv.Export(ds.Tables(0))
            Response.Clear()
            Response.ContentType = "text/csv"
            Response.AddHeader("Content-Disposition", "attachment;filename=facturatie.csv")
            Response.OutputStream.Write(fc, 0, fc.Length)
            Response.End()
        Else
            lblMessage.Text = "Er zijn geen resultaten gevonden."
        End If
[/code]

I dont want to show the lbMessage when there is found results. But because of the Response.Clear() method clears the HTML. SO that doesnt work. So how to manage that you will not see the lbMessage() when  results found

Thank you





Answers (2)