Results 1 to 9 of 9

Thread: [02/03] keep page same level?[Resolved]

  1. #1

    Thread Starter
    PowerPoster
    Join Date
    Aug 2003
    Location
    Edinburgh, UK
    Posts
    2,773

    [02/03] keep page same level?[Resolved]

    Hi. I was wondering in ASP.NET if it is possible to keep the page position where it currently is, after a postback event?

    Is this possible? if so - how?

    So say, half way down the page I have a button which posts back to the server, or a drop down list which has an autopostback event, I want it not to move the page back to the top and do a postback but rather do a postback and keep the page where it is currently being held/viewed.

    I know a postback is like a refresh in browser terms, sends data back to the server etc... but thought there would be a way of it to do all that and keep the same place on the page!

    Thanks
    Last edited by Techno; Apr 12th, 2006 at 01:21 PM.

    MVP 2007-2010 any chance of a regain?
    Professional Software Developer and Infrastructure Engineer.

  2. #2
    Fanatic Member
    Join Date
    May 2005
    Posts
    608

    Re: [02/03] keep page same level?

    You can use SmartNavigation=True at the page level. It has a couple of cool features.

    Just make sure it doesn't mess up any of your page's behavior. It's been known to happend.

    HTH
    HoraShadow
    I do like the reward system. If you find that my post was useful, rate it.

  3. #3

    Thread Starter
    PowerPoster
    Join Date
    Aug 2003
    Location
    Edinburgh, UK
    Posts
    2,773

    Re: [02/03] keep page same level?

    Thanks for that!
    unfortunatly it did not work, using IE 6 over here. It says to place the SmartNavigation=true in the aspx page (not in code) and i have done so but

    I put it in the very top line (Page)

    MVP 2007-2010 any chance of a regain?
    Professional Software Developer and Infrastructure Engineer.

  4. #4
    Super Moderator RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,713

    Re: [02/03] keep page same level?

    In most circumstances, do not set this property in code. Set the SmartNavigation attribute to true in the @ Page directive in the .aspx file. When the page is requested, the dynamically generated class sets this property.
    This is exactly what I needed for a page I have with a big table and lots of controls on it that does many postbacks. WORKS GREAT!

    I just placed it as the first line in the page_load event.
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  5. #5

    Thread Starter
    PowerPoster
    Join Date
    Aug 2003
    Location
    Edinburgh, UK
    Posts
    2,773

    Re: [02/03] keep page same level?

    hmm
    well it said not to place it in code but rather on the other Page (html layout).... and ive done that and didnt work.

    prefer not to use it in the load event just in case for best practice

    MVP 2007-2010 any chance of a regain?
    Professional Software Developer and Infrastructure Engineer.

  6. #6
    Super Moderator RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,713

    Re: [02/03] keep page same level?

    How about setting it from the property grid while viewing the page in Design View?
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  7. #7

    Thread Starter
    PowerPoster
    Join Date
    Aug 2003
    Location
    Edinburgh, UK
    Posts
    2,773

    Re: [02/03] keep page same level?

    I actually just sorted it out, no idea what the problem was but its sorted lol
    many thanks!

    MVP 2007-2010 any chance of a regain?
    Professional Software Developer and Infrastructure Engineer.

  8. #8
    Fanatic Member
    Join Date
    May 2005
    Posts
    608

    Re: [02/03] keep page same level?

    np and np

    HoraShadow
    I do like the reward system. If you find that my post was useful, rate it.

  9. #9
    Junior Member
    Join Date
    Oct 2006
    Posts
    22

    Re: [02/03] keep page same level?[Resolved]

    was looking for this also - a big thankyou from me

    opps - that is now obsolete - I guess that will teach me to trawl up old posts ....

    Just incase someone else looks at this post I used

    maintainScrollPositionOnPostback="true"

    that seems to work a treat
    Last edited by Ping_Chow_Chi; Jun 5th, 2008 at 02:57 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width