Re: Adding headers (General questions)
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.WebServerweb1.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 SubPrivate 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 SubPublic 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:
- Adding headers - Matt Crook, 2011-01-14, 05:08
- Re: Adding headers - woddrazen, 2011-01-14, 10:12
- Re: Adding headers - Matt Crook, 2011-01-14, 22:56
- Re: Adding headers - woddrazen, 2011-01-14, 23:54
- Re: Adding headers - Matt Crook, 2011-01-15, 00:32
- Re: Adding headers - Matt Crook, 2011-01-15, 08:12
- Re: Adding headers - woddrazen, 2011-01-15, 11:11
- Re: Adding headers - Matt C, 2011-01-19, 08:51
- Re: Adding headers - wodDamir, 2011-01-19, 09:46
- Re: Adding headers - Matt C, 2011-01-19, 08:51
- Re: Adding headers - woddrazen, 2011-01-15, 11:11
- Re: Adding headers - Matt Crook, 2011-01-15, 08:12
- Re: Adding headers - Matt Crook, 2011-01-15, 00:32
- Re: Adding headers - woddrazen, 2011-01-14, 23:54
- Re: Adding headers - Matt Crook, 2011-01-14, 22:56
- Re: Adding headers - woddrazen, 2011-01-14, 10:12