• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 349
  • Last Modified:

smart navigation alternative..

I have been searching online for alternative of asp.net smart navigation but many of the java scripts which I found didn’t work with custom user controls, or were too slow and really complex. I am looking for some simple and fast solution. If you know of any please let me know.
Thanks
0
Carl3003
Asked:
Carl3003
  • 5
  • 5
1 Solution
 
raterusCommented:
SmartNavigation does so many things, is there something particular you want to emulate?
0
 
Carl3003Author Commented:
i just want to be able to return at the same position after submiting the form .
0
 
raterusCommented:
ahh that, you can do this in javascript pretty easily.  Find an element you want to scroll to, and do this

document.getElementById("myControlsClientID").scrollIntoView();
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
Carl3003Author Commented:
If i have many elements than i should include all of them?
0
 
raterusCommented:
I'm not sure I understand what you mean, why would you want to scroll to different elements all at the same time?
0
 
Carl3003Author Commented:
document.getElementById("myControlsClientID").scrollIntoView();

The way I understand this statement determines that coordinates for only one element , right? So if I have couple of buttons-I have many because I am using datagrid, so its all full with some buttons-than I have to declare the java script statement for each button, right ?
0
 
raterusCommented:
You'd still only pick one element out of the bunch to scroll too right?, now depending on what they messed with in the datagrid, you will want to scroll to a different position, and thus will need to set the id in this javascript to a different value each time, is this what you are talking about?
0
 
raterusCommented:
Here is what I'd do to scroll to a particular row in the DataGrid

        Public Sub SetScrollIntoViewIndex(ByVal RowIndex As Integer)
            Dim dgi As DataGridItem = myDataGrid.Items(RowIndex)
            dgi.Attributes.Add("id", dgi.ClientID)
            Page.RegisterStartupScript("DataGridScrollToIndex", "<script language='JavaScript'>document.getElementById('" & dgi.ClientID & "').scrollIntoView();</script>")
        End Sub

Usage:

SetScrollIntoViewIndex(44) 'Scrolls to the 45th row in the datagrid when the page loads.
0
 
Carl3003Author Commented:
actually, i want to to be able to return at the same position not just on the datagrid but on each html element i have clicked. For instance if i refresh the page i should be able to return to the same position as well. This is what the smartNavigation is doing in asp.net .
0
 
dharmesh_amityCommented:
check this link out. Maybe that's what you want

http://www.sitepoint.com/print/preserve-page-scroll-position
0
 
Carl3003Author Commented:
this web site is excactly what i wanted but i am still open other interesting solution like this one if you have any, please share  with us..
http://aspnet.4guysfromrolla.com/articles/111704-1.aspx
Thanks to anyone
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 5
  • 5
Tackle projects and never again get stuck behind a technical roadblock.
Join Now