Insert a "Bookmark" in a webform?`

Tacec

Member
Joined
Jun 14, 2005
Messages
18
Location
Renton, WA
Programming Experience
1-3
I've used numerous other programs to bookmark a point within a form using links. Can this be done in a webform using event handlers? (ie. a radio button is clicked, the view jumps to a specific point on the form.)

I've found the "Insert Bookmark" option under the Format menu item but can find no reference to using that bookmark in vb code. Is this possible??

I'm pretty new at webforms. Any help would be appreciated.
Thanks!!
 
The bookmark feature can be used to jump to a section of the web page by adding a pound and the name of the bookmark to the current url.
For example, if your url is http://domain.com/default.aspx and you have a bookmark named bookmark (<a name="bookmark" />) you can jump to that bookmark by going to http://domain.com/default.aspx#bookmark
To do this with the clicking of a radio button, you could use Response.Redirect(url).
Javascript is another option.
 
not working.....

Thanks for the reply, Paszt. I knew there was some way to do it.

I just can't find any documentation on it. How frustrating. I inserted the bookmark on my page, and since I'm running it off my machine, my url is localmachine...etc. This is what I entered:
VB.NET:
[SIZE=2][COLOR=#0000ff]Private[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]Sub[/COLOR][/SIZE][SIZE=2] rdolNewEmployee_SelectedIndexChanged([/SIZE][SIZE=2][COLOR=#0000ff]ByVal[/COLOR][/SIZE][SIZE=2] sender [/SIZE][SIZE=2][COLOR=#0000ff]As[/COLOR][/SIZE][SIZE=2] System.Object, [/SIZE][SIZE=2][COLOR=#0000ff]ByVal[/COLOR][/SIZE][SIZE=2] e [/SIZE][SIZE=2][COLOR=#0000ff]As[/COLOR][/SIZE][SIZE=2] System.EventArgs) [/SIZE][SIZE=2][COLOR=#0000ff]Handles[/COLOR][/SIZE][SIZE=2] rdolNewEmployee.SelectedIndexChanged[/SIZE]
[SIZE=2][COLOR=#0000ff]If[/COLOR][/SIZE][SIZE=2] rdolNewEmployee.SelectedValue = 2 [/SIZE][SIZE=2][COLOR=#0000ff]Then[/COLOR][/SIZE]
[SIZE=2]Response.Redirect("http://localhost/UserNeedsForm/MainPage.aspx#Software")[/SIZE]
[SIZE=2][COLOR=#0000ff]End[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]If[/COLOR][/SIZE]
[COLOR=#0000ff]End Sub[/COLOR]

But when I run it and select value 2 on the form, it does nothing. What could I have missed?

Thanks!
 
There have to be enough remaining page below the named anchor to fill a full page for it to take full effect, ie you can't scroll beyond the end of page. The Html anchor tag is well documented, see for example this tutorial page.
If you're not navigating to a different path just use the page, Response.Redirect("MainPage.aspx#Software")
 
Back
Top