Re: Adding headers - WeOnlyDo Discussion board

Re: Adding headers (General questions)

by woddrazen, Friday, January 14, 2011, 23:54 (5062 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


Complete thread: