Or by JavaScript:
<%@ Page Title="My Page" Language="VB" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
</head>
<body>
<div id="first" style="height:600px">First</div>
<div id="second" style="height:600px">Second</div>
<div id="third" style="height:600px">Third</div>
<script>
setTimeout('document.getElementById("<% If (10 > 0) Then Response.Write("second") %>").scrollIntoView(true)',0);
</script>
</body>
</html>
For the Anchor tags was this my VB code:
<% If (10 > 0) Then %>
<script>location.hash="second";</script>
<% End If %>
But you can do it also like the second example with VB statement: Response.Write()
Remove the blank char after < char.
There is a problem with the EE code snippet editor.
You are welcome : )
Jump to anchor name:
<%@ Page Title="My Page" Language="VB" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
</head>
<body>
<a name="first"></a>
<div style="height:600px">First</div>
<a name="second"></a>
<div style="height:600px">Second</div>
<a name="third"></a>
<div style="height:600px">Third</div>
<% If (10 > 0) Then %>
<script>location.hash="second";</script>
<% End If %>
</body>
</html>