Results 1 to 10 of 10

Thread: AutopostBack

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Jan 2001
    Location
    Denmark
    Posts
    1,049

    Question AutopostBack

    I have a form including a scrollbar. If I click a checkbox some of the content becomes invisible. But if I do that at the bottom of the page, then the page reloads and goes to the top. That's not smart! I wish to solve this without JS but I see some problems using AutopostBack. Isn't it possible to reload the page where the scrollbar was placed?

  2. #2
    I wonder how many charact
    Join Date
    Feb 2001
    Location
    Savage, MN, USA
    Posts
    3,704
    There is a way if you use AutoPostBAck, in which you have a hidden value field in there, and you attach an anchor to the row/cell in which the value lies, but then again, i think that relies on javascript. I will have to check when i get back to work.

    and the other solution, you obviously know about is element.scrollIntoView(); which only works in IE5 + I believe.

    I don't really understand your reservations about Javascript, since it really is a must in modern websites these days.

    If you turn of javascript and visit many 'super duper' sites, you will find they alert you that either you cannot use the site, or much of the functionality will be broken. (Same if you block cookies).

  3. #3

    Thread Starter
    Frenzied Member
    Join Date
    Jan 2001
    Location
    Denmark
    Posts
    1,049
    The reason why I don't want to use JS is that all my combo boxes are based on database connections, and that is not great using JS.
    But I will look at the element.scrollIntoView(), I haven't used that before. Do you think this would solve the problem?

  4. #4
    I wonder how many charact
    Join Date
    Feb 2001
    Location
    Savage, MN, USA
    Posts
    3,704
    document.scrollIntoView is a javascript function of Internet Explorer.

    So, no, it won't solve your problem if you can't use jscript.

    Having javascript enabled doesn't mess with your comboboxes, even if they are databound on code-behind.

    All, this jscript will do is scroll the presentation layer, it does not change values of anything.

  5. #5
    PowerPoster hellswraith's Avatar
    Join Date
    Jul 2002
    Location
    Washington St.
    Posts
    2,464
    Put the smartNavigation on.
    You can do it per page in the page directive, or you can do it in the web.config as shown below:

    <configuration>
    <system.web>
    <pages smartNavigation="true">/
    </system.web>
    </configuration>

  6. #6
    Member CommanderEl's Avatar
    Join Date
    Feb 2005
    Location
    Adelaide, Australia
    Posts
    40

    Re: AutopostBack

    Quote Originally Posted by hellswraith
    Put the smartNavigation on.
    You can do it per page in the page directive, or you can do it in the web.config as shown below:

    <configuration>
    <system.web>
    <pages smartNavigation="true">/
    </system.web>
    </configuration>

    legend, this totally works
    damn, now i need to learn all the nifty tags associated with webconfig

  7. #7
    Lively Member zen_master's Avatar
    Join Date
    Apr 2005
    Location
    Buffalo, NY
    Posts
    114

    Re: AutopostBack

    interesting.........

  8. #8
    I wonder how many charact
    Join Date
    Feb 2001
    Location
    Savage, MN, USA
    Posts
    3,704

    Re: AutopostBack

    Well, I thought we had a thread about this long ago and agreed SmartNavigation was broken because it really messes up css and DOM manipulation - and acts erratically. http://weblogs.asp.net/ksamaschke/ar...4/27/6085.aspx

    http://www.codeproject.com/aspnet/lili.asp

    http://www.aewnet.com/nntp/id-117893.html

    Now I hear Hellswraith and Mendhak promoting it - what's going on here? Have you two found a fix that I haven't?

    If a person was to put focus back to where it was before postback, javascript is the only real true friend here...
    http://www.aspnetpro.com/NewsletterA...200309bm_l.asp
    Last edited by nemaroller; May 25th, 2005 at 06:07 AM.

  9. #9
    PowerPoster hellswraith's Avatar
    Join Date
    Jul 2002
    Location
    Washington St.
    Posts
    2,464

    Re: AutopostBack

    Quote Originally Posted by nemaroller
    Well, I thought we had a thread about this long ago and agreed SmartNavigation was broken because it really messes up css and DOM manipulation - and acts erratically. http://weblogs.asp.net/ksamaschke/ar...4/27/6085.aspx

    http://www.codeproject.com/aspnet/lili.asp

    http://www.aewnet.com/nntp/id-117893.html

    Now I hear Hellswraith and Mendhak promoting it - what's going on here? Have you two found a fix that I haven't?

    If a person was to put focus back to where it was before postback, javascript is the only real true friend here...
    http://www.aspnetpro.com/NewsletterA...200309bm_l.asp
    If you will notice, that post is over a year old (04-02-2004). This thread was brought back to life. I use custom javascript to set focus after postback now, as I did have some problems with SmartNavigation. Now, it isn't totally broke, it did work on some of the pages I developed, but as I got more skilled with asp.net, my applications became more complex and out grew the SmartNavigation real quick.

  10. #10
    Lively Member zen_master's Avatar
    Join Date
    Apr 2005
    Location
    Buffalo, NY
    Posts
    114

    Re: AutopostBack

    that's nice..

    actually can you pinpoint me to something?

    i got two pages of aspx...now, when i go to the second back and go back trough hyperlink......why the first page's settings (checkbox, buttons, blabla) all gone?

    does this has to do anything with session? please help me =)

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