05 Oct 2005, 1:46
|
mike55
Joined on 01-20-2005
Posts 40
|
Using bookmarks within a page.
|
|
|
Hi all
I am trying to set-up my page that when the user clicks the next button, validation will be performed. If the validation fails, the user will be redirected to where the validation summary appears in the page, could be at the top, bottom, or in the middle.
I have created a number of anchors around my page and I am able to redirect to them without loosing any of my information in the event of an error. The problem that I am having is that a new instance of the page is being created each time that I do the redirect to the anchor location even though I am using javascipt to handle the redirection.
Here is my code:
|
|
Private
Sub
registerAnchorScript(
ByVal
strAnchorID
As
String
)
Dim
Script
As
String
Script &= "
Script &= "var hashValue='#" & strAnchorID & "';" & vbCrLf
Script &= "if(location.hash!=hashValue)" & vbCrLf
Script &= "location.hash=hashValue;" & vbCrLf
Script &= "" & vbCrLf
If
(
Not
Page.IsStartupScriptRegistered("BookMarkScript"))
Then
Page.RegisterStartupScript("BookMarkScript", Script)
End
If
End
Sub
|
I simple pass the name of the anchor that I want to redirect to into this method.
Appreciate any suggestions.
Mike55.
|
|
|
|
|
|
|
|