Server.Execute and Postbacks

mark007

Centurion
Joined
Jan 22, 2005
Messages
185
Location
York, UK
I have an asp.net application that is mainly a front end to a database. For some of the tables there is some text that accompanies it that I don't really want to store in the database but want to include on the web page.

The pages containing the text are simple html pages in the same folder as everything else so I was inluding them using:

Visual Basic:
Try
Dim l As New Literal
Dim textWriter As New System.IO.StringWriter
Server.Execute(strTable & "info.htm", textWriter)
l.Text = textWriter.ToString() & "<br><br>"
Me.phGrid.Controls.Add(l)
Catch ex As Exception
       strError=ex.ToString
End Try

This all looked fine. The problem though is that now my postbacks don't work and nothing is displayed. If I comment out the server.execute then the pages work fine but without the included files. If I enclose it in a if not me.ispostback then it still doesn't work...

Afetre searching the net it seemed to be a documented issue fixed by this service pack:

http://www.microsoft.com/downloads/...4F-088E-40B2-BBDB-A83353618B38&displaylang=en

But installing di not solve the problem.

Therefore does have anyone have any ideas on how to a) solve it or b) use something else to the same effect.

Thanks.

:)
 
Ok, well I've got round it by just reading the html as a text file. Would still be interested on any information on the problem though.

:)
 
Back
Top