Print Page | Close Window

[SOLVED!] Web Browser Control Navigate error.

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Controls
Forum Description: Topics Related to Codejock Controls
URL: http://forum.codejock.com/forum_posts.asp?TID=16058
Printed Date: 11 May 2024 at 5:21am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: [SOLVED!] Web Browser Control Navigate error.
Posted By: shipwreck
Subject: [SOLVED!] Web Browser Control Navigate error.
Date Posted: 22 January 2010 at 12:48pm
[SOLVED: VIEW POSTS BELOW FOR SOLUTION.]
Hello everyone.
I would like to have custom error pages within my browser that would be displayed depending on the error that happens.
I'm pretty familiar with error codes such as 404 and so on but I don't really know how to implement these into the control. I'm assuming it is under the navigate error even but Not sure what code or API that would need to be added here.

Anyone help out a bit? I'd really appreciate it!

Thanks & Regards in advance!

-------------
Product: Xtreme Suite Pro (Active-X), Version 15.3.1

Platform: Windows 7 Ultimate SP1 (64Bit) & Windows XP Mode SP3 (32Bit)

Language: Visual Basic 6.0 SP6



Replies:
Posted By: shipwreck
Date Posted: 22 January 2010 at 5:58pm
Well, wouldn't you know that I was able to solve this one on my own as well. I guess we really do learn something new every day.

I will post another post below this one explaining the code I used to solve the problem just in case any of you all happen to run into any trouble too!

-------------
Product: Xtreme Suite Pro (Active-X), Version 15.3.1

Platform: Windows 7 Ultimate SP1 (64Bit) & Windows XP Mode SP3 (32Bit)

Language: Visual Basic 6.0 SP6


Posted By: shipwreck
Date Posted: 22 January 2010 at 6:04pm
Okay, I'll try to explain this the best that I can:

What you'll need:
• One Web Browser control (I named mine "WB").
• One CJ PushButton (This isn't really required.)

in the click event of the button place this code.

Private Sub btnWB_Click()
WB.Navigate ("http://www.google.co.in/test.htm")
' This is a bogus link. It's used to display an error.
End Sub

Next, under the WB's navigate error event, add:

Private Sub WB_NavigateError(ByVal pDisp As Object, URL As Variant, TargetFrameName As Variant, StatusCode As Variant, Cancel As Boolean)
If StatusCode = 404 Then MsgBox "Server not found."
End Sub

Hope this helps everyone as much as it has me.

-------------
Product: Xtreme Suite Pro (Active-X), Version 15.3.1

Platform: Windows 7 Ultimate SP1 (64Bit) & Windows XP Mode SP3 (32Bit)

Language: Visual Basic 6.0 SP6



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net