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 / .NET Framework / New Users / July 2006

Tip: Looking for answers? Try searching our database.

WebBrowser object and redirects

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
ewahl@nextmillenniumweb.com - 10 Jul 2006 05:09 GMT
Hi folks,

I have searched for an answer to this question on the internet, but
been unable to find it so far. I am hoping somebody can help me out.
When you are using a WebBrowser object in .Net 2.0, is there any way
that you can intercept when the server you are pointing to issues a
Response.Redirect. That is, I can handle the Navigating and Navigated
events, but the first only gets called before the initial page is
called, and the second only gets called when the final, redirected-to
page, is loaded. I can't find any way of capturing the redirect itself
and doing something at that point. (I hope that was clear.) Can anybody
tell me if it's possible to intercept the redirect, and if so, how?
Thanks much in advance.

-Eric
Cowboy (Gregory A. Beamer) - MVP - 10 Jul 2006 15:19 GMT
Response.Redirect is done on the client side overall. The server sends an
"instant" redirect command and the client obeys. Can you capture the event?
There are a couple of ways, depending on your needs. One of the easiest is to
redirect with a command line variable (QueryString) and use that var to
realize it has been redirected. Another is to hang something in session that
a redirect happened. But, you cannot simply figure it out, as the server sees
the redirected hit just like any other hit to the site. As web servers are
stateless, you have to persist the fact a redirect was requested.

Signature

Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

***************************
Think Outside the Box!
***************************

> Hi folks,
>
[quoted text clipped - 11 lines]
>
> -Eric
ewahl@nextmillenniumweb.com - 10 Jul 2006 18:39 GMT
That sounds like a way to handle redirects from the server side, but I
need to do something on the client side. If the server sends a
redirect, I want to be able to add some information to the querystring
before the redirect actually happens. But, this needs to happen on the
client side. (Assume that I have no control over what the server code
does, that I am simply fulfilling a requirement that I have for
client-side behavior.) Is there any way to do that? I realize this is
not standard behavior for a "regular" web browser, but I am trying to
emulate something that a third-party piece of hardware (that can web
browse) might do. Thanks.

-Eric

Cowboy - MVP (Gregory A. Beamer) wrote:
> Response.Redirect is done on the client side overall. The server sends an
> "instant" redirect command and the client obeys. Can you capture the event?
[quoted text clipped - 4 lines]
> the redirected hit just like any other hit to the site. As web servers are
> stateless, you have to persist the fact a redirect was requested.

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.