473,385 Members | 1,869 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

smartnavigation alternative solution

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=saveSc rollPosition;")
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=setScroll Position;")
setScrollPosition.Append("</script>")

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

End Sub
Thanks in advance,
Sam.

Nov 19 '05 #1
1 2355
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
<sr*****@mailcity.com> wrote in message
news:11**********************@f14g2000cwb.googlegr oups.com...
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=saveSc rollPosition;")
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=setScroll Position;")
setScrollPosition.Append("</script>")

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

End Sub
Thanks in advance,
Sam.

Nov 19 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Jan Heppen | last post by:
Hi, I'm having a problem with SmartNavigation. When I open up a new (popup) window using response.redirect on one of my web pages, the new window doesn't come on top the parent window. It goes...
4
by: Bobby | last post by:
Hi all... I rather confuse using smartnavigation in my web application because if I set the "smartnavigation = true" then If I run my app, then after I post page that page, using event...
5
by: ddt.demos.su | last post by:
I have had some problems with using Samrtnavigation. Using a frame solution where initially a datagrid is displayed, which when an item is selected hides the datagrid panel & presents a panel of...
3
by: Nestus | last post by:
Hi, im developing a solution in ASP.Net, i have a page that i need to use the smartnavigation in true, the problem occurs when i put in the directive @Page SmartNavigation = true my page trhows a...
0
by: magister | last post by:
Hello, I am using a hierarical datagrid which injects client script which seems to cause problems with smartnavigation. I have got an alternative which maintains the scroll position but I...
2
by: magister | last post by:
Does smartnavigation on parent page make user controls page_load twice... Any fixes for this!!! Problem is when boss sees smartnavigation he likes but it causes lots of other bugs....why...
2
by: Wysiwyg | last post by:
Has anyone found a reasonable way to emulate smartnavigation functionality for any browser? I'd really like to avoid creating history entries when posting back to the same page. SmartNavigation...
5
by: Mogens Nielsen - Elbek & Vejrup A/S | last post by:
Hi, I can see from the msdn-docs that SmartNavigation is now obsolete. Why is that? The SmartNavigation feature has been replaced by MaintainScrollPosition, but the scoll position is not why...
1
by: danyeungw | last post by:
I get the following from the link http://support.microsoft.com/kb/314206. I need to have both work - the page stays where it is and set focus to next control. Does anyone have solution? I have...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.