G
Guest
Hello, i have a problem, i must to make a response.redirect, with a fixed
header (authentication header) but i dont know how to do it... i make this,
but im stuck here...
Dim strURL As String = "http://localhost/webapplication1/webform1.aspx"
Response.ClearHeaders()
Response.ClearContent()
Dim ReportWebRequest As System.Net.HttpWebRequest =
CType(System.Net.WebRequest.Create(strURL), System.net.HttpWebRequest)
ReportWebRequest.Timeout = 10000
ReportWebRequest.MaximumAutomaticRedirections = 50
Dim cCache = New System.Net.CredentialCache
cCache.Add(New Uri(strURL), "Basic", New
System.Net.NetworkCredential("user", "pass", "domain"))
ReportWebRequest.Credentials = cCache
ReportWebRequest.PreAuthenticate = True
Dim ReportWebResponse As System.net.WebResponse
ReportWebResponse = CType(ReportWebRequest.GetResponse(),
System.net.WebResponse)
Response.RedirectLocation = strURL
Dim i As Integer
For i = 0 To ReportWebRequest.Headers.Count - 1
Response.AddHeader(ReportWebRequest.Headers.Keys(i).ToString(),
ReportWebRequest.Headers.Item(i).ToString())
Next
add code here... what could i make next? response redirect clear the
header that i make... i dont know what to do...
thanks to all!!!
header (authentication header) but i dont know how to do it... i make this,
but im stuck here...
Dim strURL As String = "http://localhost/webapplication1/webform1.aspx"
Response.ClearHeaders()
Response.ClearContent()
Dim ReportWebRequest As System.Net.HttpWebRequest =
CType(System.Net.WebRequest.Create(strURL), System.net.HttpWebRequest)
ReportWebRequest.Timeout = 10000
ReportWebRequest.MaximumAutomaticRedirections = 50
Dim cCache = New System.Net.CredentialCache
cCache.Add(New Uri(strURL), "Basic", New
System.Net.NetworkCredential("user", "pass", "domain"))
ReportWebRequest.Credentials = cCache
ReportWebRequest.PreAuthenticate = True
Dim ReportWebResponse As System.net.WebResponse
ReportWebResponse = CType(ReportWebRequest.GetResponse(),
System.net.WebResponse)
Response.RedirectLocation = strURL
Dim i As Integer
For i = 0 To ReportWebRequest.Headers.Count - 1
Response.AddHeader(ReportWebRequest.Headers.Keys(i).ToString(),
ReportWebRequest.Headers.Item(i).ToString())
Next
add code here... what could i make next? response redirect clear the
header that i make... i dont know what to do...
thanks to all!!!