Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / July 2005

Tip: Looking for answers? Try searching our database.

response.addheader

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Rothariger - 18 Jul 2005 15:36 GMT
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!!!
Bruce Barker - 18 Jul 2005 18:00 GMT
a redirect is just a header, you could just do the redirect yourself.

-- bruce (sqlwork.com)

> 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
[quoted text clipped - 32 lines]
>
> thanks to all!!!
Rothariger - 18 Jul 2005 18:11 GMT
i didnt understand...

or how can i make the redirect myself?

> a redirect is just a header, you could just do the redirect yourself.
>
[quoted text clipped - 36 lines]
> >
> > thanks to all!!!
Rothariger - 18 Jul 2005 18:45 GMT
hey bruce, i try

Response.Status = "301 Moved Permanently"
Response.AddHeader("Location", strURL)

before the for cicle, and after it, but it makes the same as
response.redirect... i need that the IIS get its credentials...

> i didnt understand...
>
[quoted text clipped - 40 lines]
> > >
> > > thanks to all!!!
Joerg Jooss - 18 Jul 2005 21:55 GMT
> 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...
[...]

A redirect must be issued from the server-side, but your code runs on
the client-side. That won't work.

Cheers,
Signature

http://www.joergjooss.de
mailto:news-reply@joergjooss.de


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.