Solved

URL & Parameters (POST)  from IWebBrowser2 current page

Posted on 2002-06-05
7
588 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
Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

 

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

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Installing Microsoft R server on REDHAT or SUSE Linux 4 136
sameEnds challenge 3 157
difference between String.subString() and String.subSequence() 6 193
Making an alias 7 93
Introduction: Finishing the grid – keyboard support for arrow keys to manoeuvre, entering the numbers.  The PreTranslateMessage function is to be used to intercept and respond to keyboard events. Continuing from the fourth article about sudoku. …
Introduction: Dialogs (2) modeless dialog and a worker thread.  Handling data shared between threads.  Recursive functions. Continuing from the tenth article about sudoku.   Last article we worked with a modal dialog to help maintain informat…
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.
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…

808 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