smartnavigation alternative solution

S

sri_san

Hello,
I looked at alternatives to SmartNavigation and found the code
listed here. I am not able to get the code working on pages which has a
datagrid with EditCommandColumn(edit/update are image buttons). Not
sure why the code below is not working. Any help would be great!!


Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load

Dim saveScrollPosition As New StringBuilder
Dim setScrollPosition As New StringBuilder

RegisterHiddenField("__SCROLLPOS", "0")

saveScrollPosition.Append("<script language='javascript'>")
saveScrollPosition.Append("function saveScrollPosition() {")
saveScrollPosition.Append(" document.forms[0].__SCROLLPOS.value =
thebody.scrollTop;")
saveScrollPosition.Append("}")
saveScrollPosition.Append("thebody.onscroll=saveScrollPosition;")
saveScrollPosition.Append("</script>")

RegisterStartupScript("saveScroll", saveScrollPosition.ToString())

If (Page.IsPostBack = True) Then
setScrollPosition.Append("<script language='javascript'>")
setScrollPosition.Append("function setScrollPosition() {")
setScrollPosition.Append(" thebody.scrollTop = " &
Request("__SCROLLPOS") & ";")
setScrollPosition.Append("}")
setScrollPosition.Append("thebody.onload=setScrollPosition;")
setScrollPosition.Append("</script>")

RegisterStartupScript("setScroll", setScrollPosition.ToString())
End If

End Sub


Thanks in advance,
Sam.
 
S

S. Justin Gengo

Sam,

I have a ScrollToElement method in a free Javascript component on my
website, www.aboutfortunate.com, that works similarly (except I know it
works for sure) to the code you posted here. Just click the "Code Library"
button at the top of the site and then click the "Javascript" button in the
menu on the left. The project also has many other useful scripts in it. Even
if you don't want to use the entire object you could certainly strip out the
ScrollToElement code. Feel free to email me if you have any questions.

--
Sincerely,

S. Justin Gengo, MCP
Web Developer / Programmer

www.aboutfortunate.com

"Out of chaos comes order."
Nietzsche
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,994
Messages
2,570,223
Members
46,813
Latest member
lawrwtwinkle111

Latest Threads

Top