Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Keep page at current location during post back 1

Status
Not open for further replies.

dvannoy

MIS
May 4, 2001
2,765
0
0
US
I have a page with several dg's and ddl's. the users enter data and scroll down the page. how can I stop the page from jumping back to the default position after chossing an item from a ddl that's at the bottom of the page? I need the ddl's auto post back to = true. so I can't change that.

any help would be appreciated
thanks

 
dvannoy - I just came across a thread yesterday that covered this same issue (arguing among other things the use of SmartNavigation) but additional arguments were presented as well that may prove to be a solution. I'll go through my history and see if I can recover the thread in which this was discussed.
 
thanks...I don't even have SmartScoller listed in my toolbox. is that a plug in to asp or what?

 
article said:
My technique involves the use of a simple custom control, SmartScroller...In this article we'll look at how to use SmartScroller, as well as the control's source code.
It's a control they created themselves and that's what the article is about as it show's the source code to create it. There have been many posts on the same subject here on TT that show a simple way to scroll to a particular control if you don't want to follow that method.


____________________________________________________________

Need help finding an answer?

Try the Search Facility or read FAQ222-2244 on how to get better results.

 
I am trying to use SmartNavigation..

why does it direct me to this page SmartNav.htm ?

I tryed setting SN in the web config and also the html.

 
what I think I will do is set the focus manually

Private Sub SetFocus(ByVal ctrl As System.Web.UI.Control)

Dim s As String = "<SCRIPT language='javascript'>document.getElementById('" & ctrl.ID & "').focus() </SCRIPT>"

RegisterStartupScript("focus", s)

End Sub

this way I can control it better. it's only a small section at the bottom that's my problem.

I still would like to know why I couldn't get SN to work.

 
You should only need to set it in the page itself. can you supply an example of how you have done this?

Saying that, it may indicate a problem with the framework if you are being redirected.


____________________________________________________________

Need help finding an answer?

Try the Search Facility or read FAQ222-2244 on how to get better results.

 
<%@ Page Language="vb" AutoEventWireup="false" SmartNavigation="true" Codebehind="Page.aspx.vb" Inherits="xx.xx"%>

 
I must have posted at the same time you posted the alternative method to SmartNavigation - that would be my recommended method as it saves the problems you may encounter otherwise.


____________________________________________________________

Need help finding an answer?

Try the Search Facility or read FAQ222-2244 on how to get better results.

 
Just my 2 pennies...

look on the server for wwwroot\aspnet_client\system_web\[version]\SmartNav.htm
-and
take out the AutoEventWireup="false" from your page block and try it
 
dvannoy - many contributors of earlier threads suggested that SmartNavigation was problematic; some utilized the javascript setFocus method. I haven't looked into the particulars; sounds like you may have had some luck with SN.
 
hi, don't know whether this is helpful to you but it's the method I use to solve the problem you are describing.

the idea is to manually catch the postback and use a combination of the javascript methods focus() and scrollIntoView()

full details on Matt Meleski's blog here:


..
 
cjdrake - excellent reference; thanks for the link.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top