Click here to Skip to main content
16,006,475 members
Home / Discussions / C#
   

C#

 
Generalresponding to javascript in html Pin
JeromeKJerome28-Oct-04 8:02
JeromeKJerome28-Oct-04 8:02 
GeneralRe: responding to javascript in html Pin
Heath Stewart28-Oct-04 15:48
protectorHeath Stewart28-Oct-04 15:48 
GeneralRe: responding to javascript in html Pin
JeromeKJerome28-Oct-04 16:17
JeromeKJerome28-Oct-04 16:17 
GeneralRe: responding to javascript in html Pin
Heath Stewart29-Oct-04 5:28
protectorHeath Stewart29-Oct-04 5:28 
GeneralRe: responding to javascript in html Pin
JeromeKJerome29-Oct-04 8:08
JeromeKJerome29-Oct-04 8:08 
GeneralRe: responding to javascript in html Pin
JeromeKJerome29-Oct-04 9:27
JeromeKJerome29-Oct-04 9:27 
GeneralRe: responding to javascript in html Pin
JeromeKJerome29-Oct-04 13:41
JeromeKJerome29-Oct-04 13:41 
GeneralRe: responding to javascript in html Pin
Heath Stewart30-Oct-04 3:16
protectorHeath Stewart30-Oct-04 3:16 
Have you watched your traffic through a packet monitor? I find it odd - as I know you do - that your cookie isn't being sent with the GET request. Perhaps it is but the server doesn't handle the GET request and, thus, doesn't process the cookie.

If you think the cookie is coming with the HTTP redirect (again, a packet monitor really helps in these situations; you can get them all over on the web, but most will require a packet driver that, for some reason, the name seems to elude me right now - sorry) you should set HttpWebRequest.AllowAutoRedirect to false and handle it yourself. If the HTTP status code is 302, 303, or 305 (see the HttpStatusCode or on the web for the HTTP RFC or something) an exception will be thrown (which one, they don't say so give it a test and handle only that exception (other exceptions could be thrown for other reasons), which you'd handle and get the Location: header to send a request for the redirection location.

BTW, for cleaner code, you might consider using the using block statement instead of your own try-finally. It really has more to do with readability, but the effect is the same (compiles to a try-finally just as you're doing it). That's just my opinion, though. What you're doing is correct coding practice.

This posting is provided "AS IS" with no warranties, and confers no rights.

Software Design Engineer
Developer Division Sustained Engineering
Microsoft

[My Articles] [My Blog]
GeneralRe: responding to javascript in html Pin
JeromeKJerome1-Nov-04 8:09
JeromeKJerome1-Nov-04 8:09 
GeneralRe: responding to javascript in html Pin
Heath Stewart1-Nov-04 8:11
protectorHeath Stewart1-Nov-04 8:11 
GeneralVisual Studio Add-In C# Pin
Nxsis28-Oct-04 7:54
Nxsis28-Oct-04 7:54 
GeneralRe: Visual Studio Add-In C# Pin
Heath Stewart28-Oct-04 15:40
protectorHeath Stewart28-Oct-04 15:40 
GeneralOffice Programming with C# Pin
Member 140011328-Oct-04 7:02
Member 140011328-Oct-04 7:02 
GeneralRe: Office Programming with C# Pin
Heath Stewart28-Oct-04 15:35
protectorHeath Stewart28-Oct-04 15:35 
GeneralIIS server Pin
ppp00128-Oct-04 6:41
ppp00128-Oct-04 6:41 
GeneralRe: IIS server Pin
Alex Korchemniy28-Oct-04 9:59
Alex Korchemniy28-Oct-04 9:59 
GeneralRe: IIS server Pin
Heath Stewart28-Oct-04 15:22
protectorHeath Stewart28-Oct-04 15:22 
GeneralAVI to WMV Pin
ee9903528-Oct-04 6:00
ee9903528-Oct-04 6:00 
GeneralRe: AVI to WMV Pin
Heath Stewart28-Oct-04 15:10
protectorHeath Stewart28-Oct-04 15:10 
GeneralXslTransform object protection level problem Pin
kroakdammit28-Oct-04 5:48
kroakdammit28-Oct-04 5:48 
GeneralRe: XslTransform object protection level problem Pin
Heath Stewart28-Oct-04 15:05
protectorHeath Stewart28-Oct-04 15:05 
GeneralRe: XslTransform object protection level problem Pin
kroakdammit28-Oct-04 23:24
kroakdammit28-Oct-04 23:24 
GeneralRe: XslTransform object protection level problem Pin
kroakdammit28-Oct-04 23:33
kroakdammit28-Oct-04 23:33 
GeneralCopy a piece of an Image Pin
delemur28-Oct-04 5:20
delemur28-Oct-04 5:20 
GeneralRe: Copy a piece of an Image Pin
Christian Graus28-Oct-04 9:36
protectorChristian Graus28-Oct-04 9:36 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.