Click here to Skip to main content
15,884,472 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello everybody , I made Web Browser using GeckoFX In VB.NET but how to create a custom button control for saving the current html page as the following code is not working like the normal webbrowser in Visual studio tools

Geckowebbrwoser.show save as dialogue

So. please it would be highly appreciated if you kindly provide us with the codes needed for adding this feature to my project.

Thanks in advance.
Posted
Comments
Nelek 9-Sep-14 18:45pm    
This is not how CP usually works. Most important goal here is to learn and help learning.
You are supposed to try it on your own, and come here when you got stuck with something, with a concrete question about your code, design, etc.
Please have a look to What have you tried?[^] to see a good explanation about what I mean.
Don't forget people here don't get payed. And besides, if we give you a ready-to-go solution, it is not going to help you because you are not going to learn anything from it.

1 solution

Depending on your GeckoFX version, you should be able to call .Navigate("view-source:" + url); on it to get the page source. You can then implement showing the Save dialog and Saving the source to the file yourself (outside GeckoFx).

Update (from comments): You can also work the other way around. Show the user a save dialog, then call .SaveDocument(filename) with the full path to the file that was entered in the save dialog.
 
Share this answer
 
v2
Comments
Nelek 9-Sep-14 18:44pm    
OP answer to you copied from non-solution below
Hi kbrandwijk ,

Thank you for your kind reply.

Please find below the files I used them to create my Gecko webbrowser
Skybound.GeckoFX.bin.v1.9.1.0
xulrunner-1.9.2.13.en-US.win32

So please help me with the exact codes to accomplish this option (Save as). Thx
kbrandwijk 9-Sep-14 20:53pm    
@Sherif Adely: Have you actually tried the method that I proposed in my solution? What results did you get? What's your current code? Where do you run into problems? We are not here to do your work, we're here to help you if you get stuck.
Sherif Adely 11-Sep-14 4:21am    
Hi kbrandwijk,please let me clarify that I have already made a Web Browser using webbrowser control (from VB.net Tools) with all needed features like save as , print review and print but I had to use Gecko webbrowser (with video help to implement it ) to open a certain URL in my company not open by normal webbrowser in VB and I was able to add forward, back , refresh , stop but the save as code didn't work as it showing an error message for the below code despite ,it has been accepted for normal webbrowser control.
Geckowebbrwoser.show save as dialogue
kbrandwijk 11-Sep-14 5:06am    
I have read your reply five times, and I still have no idea what you mean. You said in your question that you needed code to save the current page as HTML. I have shown you that the GeckoBrowser can navigate to the source, which you can then save yourself. I have now updated the solution to include another option. You have to show the save dialog yourself, and then call SaveDocument with the full path of the file you got from the save dialog.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900