Hi.
My question is best illustrated with a code sample. Try the following: Create a form, and put a WebBrowser control and a button on the form. Double-click the button, and create the following code in the click event handler:
private void button1_Click(object sender, EventArgs e)
{
webBrowser1.DocumentText =
@"<html><body><a href=""about:blank#test2"">Test</a>
<br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/>
<a name=""test2"">Test2</a><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/> ";
}
Run the form, and try to click on the "Test" link. You'll see that the navigation does not work correctly. Does anyone know of a way around this Please note that the requirements for this app does not permit storing html files on the computer's hard drive.
Thanks,
Eyvind.

Making the <A NAME="..."> tag work with the WebBrowser
Steve Clibbery
it doesnt work because whn you click it reloads about:blank, but there is no html in the page after reload.
this works -
first add a COM reference to the Microsoft Html Object Library and try this code:
Kevin Wu
Thanks anyway - any other ideas
Eyvind.
Craig Z
PQuintas
Ahmad Jalal
Hi Blair, and thank you very much for your reply. Your suggestion inspired me to find another solution to the problem, that does not involve mshtml.
Basically, the idea is to get the element using the managed HTMLDocument.GetElementById method, and using the element's ScrollIntoView method to emulate navigation.
Eyvind.
WolandIL
try
<a href="#test2">Test</a>