Solved

URL & Parameters (POST)  from IWebBrowser2 current page

Posted on 2002-06-05
7
583 Views
Last Modified: 2013-11-20
Hi there,

I'm looking for a way to query IWebBrowser2 for the current page displayed in it, including any POST parameters that were sent to it.
I've tried using BeforeNavigate2 event and keeping track of the history myself, but it's called for every frame in the page, and if I'm redirected to the same page, it's called, but the browser doesn't add it to its history, and then I lose sync with the back/forward buttons.
Another problem is when the user presses 'backspace' to go back, no event is connected to it.
Access to the history associated with the WebBrowser would have solved it, but seems like there's not such a thing.

Thank you,

Yudi.
0
Comment
Question by:Yudi
  • 3
  • 2
7 Comments
 
LVL 32

Expert Comment

by:jhance
ID: 7056011
>>for the current page displayed in it, including any POST
parameters that were sent to it.

I'm not sure I understand your question.  POST data is sent from the browser BACK TO the server, not the other way around.
0
 

Author Comment

by:Yudi
ID: 7056016
Oh, sorry, I mean every POST data that were sent to the server before the server returned the page.
0
 
LVL 12

Expert Comment

by:migel
ID: 7056150
Hi!
is method I mentoned (beforeNavigate) in the prevous your Q. not working?
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

Author Comment

by:Yudi
ID: 7056233
Hi Migel, thanks for remembering :)
Well, after some experiments, I got to the conclusion that it's not enough.
I'm trying to keep my history synchronized with the back/forward buttons, so I can know the POST data that was sent to the server for every page I got till now.
It's getting more complicated when I have more than one frame. And there are some more problems too.
The WebBrowser sometimes add the new page to the history and sometimes not (for examle, when the user clicks a link that brings him to the same page), and then my 'back/forward' buttons go out of sync.
Right now I'm working on a more complicated history tracking, but I think it might be an overkill, cause I know the WebBrowser maintains its own history, including the POST data that was sent for every page.
Sorry for the long story :) Anyway, I need something that will give me the ability to resend the request programatically for a certain page the user has been to, and I need it to work for 99% of the pages.
0
 
LVL 12

Accepted Solution

by:
migel earned 500 total points
ID: 7056266
Hi!
you can enum all frames in the current document and catch event in the any frame you want.
IMHO you need to store brief description of the document (at least frames that it hold) and check requests from the frame (store not only post data but document URL and frame that make web request)
0
 

Author Comment

by:Yudi
ID: 7056605
Well, that's what I'm trying to do now, get the URL, post data, and every URL and post data for every frame in the current page and store it in my history, but it's a bit wierd that you cannot simply access the history information from the WebBrowser...
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
how to monitor remote shell execution on linux 9 97
sum28 challenge 31 107
withoutTen challenge 14 101
zeroMAx challenge 20 88
Introduction: Displaying information on the statusbar.   Continuing from the third article about sudoku.   Open the project in visual studio. Status bar – let’s display the timestamp there.  We need to get the timestamp from the document s…
Introduction: Ownerdraw of the grid button.  A singleton class implentation and usage. Continuing from the fifth article about sudoku.   Open the project in visual studio. Go to the class view – CGridButton should be visible as a class.  R…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

863 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now