Re: Adding headers - WeOnlyDo Discussion board

Re: Adding headers (General questions)

by Matt Crook, Saturday, January 15, 2011, 08:12 (4840 days ago) @ Matt Crook

Matt,


Can you please try something like this. This worked for me without any problem
[code] Dim WithEvents web1 As WeOnlyDo.Server.WebServer
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
web1 = New WeOnlyDo.Server.WebServer

web1.DocumentRoot = AppPath() + \WebSite1
web1.DefaultPage = Default.aspx
Try
web1.Start()
Catch ex As Exception
MsgBox( There was an error: & ex.Message, vbOKOnly, Error )
End Try
End Sub

Private Sub web1_RequestDoneEvent(ByVal Sender As Object, ByVal Args As WeOnlyDo.Server.WebRequestDoneArgs) Handles web1.RequestDoneEvent
Args.User.ExecuteASPX(AppPath() + \WebSite1 , / , / , web.config )

Args.User.Response.Headers.Add( test_name , test_value )
End Sub

Public Function AppPath() As String
AppPath = System.IO.Directory.GetParent(System.IO.Directory.GetParent(System.IO.Directory.GetCurrentDirectory).ToString).ToString
End Function[/code]
If problem persist, can you maybe explain how did you check if header was sent?


Drazen


HTTP_CONNECTION:Keep-Alive, TE HTTP_ACCEPT:text/html, application/xml;q=0.9, application/xhtml+xml, image/png, image/jpeg, image/gif, image/x-xbitmap, */*;q=0.1 HTTP_ACCEPT_CHARSET:iso-8859-1, utf-8, utf-16, *;q=0.1 HTTP_ACCEPT_ENCODING:deflate, gzip, x-gzip, identity, *;q=0 HTTP_ACCEPT_LANGUAGE:en-US,en;q=0.9 HTTP_HOST:localhost HTTP_REFERER:http://localhost/ HTTP_TE:deflate, gzip, chunked, identity, trailers HTTP_USER_AGENT:Opera/9.80 (Windows NT 6.1; U; en) Presto/2.7.62 Version/11.00

this is all it returns


Complete thread: