|
||||||
| C# Programming C# (pronounced C-sharp) is a new object oriented language from Microsoft and is derived from C and C++. It also borrows a lot of concepts from Java too including garbage collection. |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
|
|||
|
Well i need a bit of code that stops redirection please. I have a link that is redirected by javascript and i need to stop it redirecting. I talked to someone and they told me to add this:
Code:
private void webBrowser1_Navigating(object sender, WebBrowserNavigatingEventArgs e)
{
if (e.Url = "http://www.runescape.com")
{
e.Cancel = true;
}
}
Thanks. Last edited by Skel; 05-13-2007 at 05:39 AM. |
| Sponsored Links |
|
|
|
|||
|
Yeh i inserted the code correcttly and repleced the URL here. The bracksets are closed, i just forgot to add them in. It underlines the bit of code with a brown line.
Error: Quote:
Last edited by Skel; 05-13-2007 at 05:38 AM. |
|
|||||
|
Your if statement is wrong. You have:
PHP Code:
PHP Code:
__________________
CodeCall Blog | CodeCall Wiki | Shareware Site | Linux Forum | Write a Blog Don't hesitate to ask any questions that you have! Check out our ASCII Calculator! |
|
|||||
|
EDIT: I should have read the initial post again.......
__________________
CodeCall Blog | CodeCall Wiki | Shareware Site | Linux Forum | Write a Blog Don't hesitate to ask any questions that you have! Check out our ASCII Calculator! |
|
|||||
|
Try this:
Code:
if (e.Url.ToString() == "http://url.here")
__________________
CodeCall Blog | CodeCall Wiki | Shareware Site | Linux Forum | Write a Blog Don't hesitate to ask any questions that you have! Check out our ASCII Calculator! |
|
|||
|
See if the IF statement is working by placing a MessageBox with the URL.ToString() value in it. Or put a break inside of it. Perhaps the URL isn't exactly what you think it is. It could be http://www.runescape.com/a/?a=2 and you are looking for an exact match. A better idea would be to search the URL for the runescape.com string.
__________________
I Need Help |
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Stop Bounce | littlefranciscan | Marketing | 5 | 02-22-2007 06:53 PM |
| URL redirection | Kaabi | Search Engine Optimization | 1 | 07-06-2006 04:42 PM |
| PHP Redirection | dirkfirst | PHP Forum | 5 | 07-05-2006 09:44 PM |
| The ultimate xHTML / DHTML / HTML 301 redirection thread! | Dan | HTML Programming | 5 | 07-04-2006 05:57 PM |
| HTML Forwarding / Redirection | RobSoftware | HTML Programming | 8 | 07-04-2006 01:33 PM |
| Xav | ........ | 1322.18 |
| MeTh0Dz|Reb0rn | ........ | 1053.7 |
| morefood2001 | ........ | 879.43 |
| John | ........ | 877.37 |
| marwex89 | ........ | 869.98 |
| WingedPanther | ........ | 830.24 |
| Brandon W | ........ | 735.07 |
| chili5 | ........ | 309.39 |
| Steve.L | ........ | 239.84 |
| dcs | ........ | 216.02 |
Goal: 100,000 Posts
Complete: 82%