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.
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.