Professional Web Applications Themes

ASP.NET results page question - Dreamweaver AppDev

I've put together an ASP.NET search/results page that works just fine. The datagrid that shows the results, however, needs to be, and is, towards the bottom of the page. But when I click the search button, the page reloads with the focus at the top. How can I get it to focus on the area where the datagrid actually is lower down on the page? Thanks!...

Sponsored Links
  1. #1

    Default ASP.NET results page question

    I've put together an ASP.NET search/results page that works just fine. The
    datagrid that shows the results, however, needs to be, and is, towards the
    bottom of the page. But when I click the search button, the page reloads with
    the focus at the top. How can I get it to focus on the area where the datagrid
    actually is lower down on the page?

    Thanks!

    Sponsored Links
    jeffpblues Guest

  2. #2

    Default Re: ASP.NET results page question

    set focus on postback site:microsoft.com


    <%= Clinton Gallagher
    METROmilwaukee (sm) "A Regional Information Service"
    NET csgallagher AT metromilwaukee.com
    URL http://metromilwaukee.com/
    URL http://clintongallagher.metromilwaukee.com/


    "jeffpblues" <com> wrote in message
    news:dfqebh$f4a$macromedia.com... 


    clintonG Guest

  3. #3

    Default Re: ASP.NET results page question

    Thanks, Clinton, but if I knew how to do that...LOL well, let me just ask if you could be more specific please. I really don't understand.
    jeffpblues Guest

  4. #4

    Default Re: ASP.NET results page question

    > Thanks, Clinton, but if I knew how to do that...LOL well, let me just ask
    if you could be more specific please. I really don't understand.

    The built in '.net smart navigation' is supposed to handle that, but, like a
    lot of built in things in .net, it works really poorly.

    So, one solution is to put in traditional anchors on your page, and then
    attach a javascript on postback to change the page focus in your button
    handler:

    pageBody.Attributes.Add("onLoad", "location.href='#yourAnchor';")

    -Darrel


    darrel Guest

  5. #5

    Default Re: ASP.NET results page question

    So, one solution is to put in traditional anchors on your page, and then
    attach a javascript on postback to change the page focus in your button
    handler:

    pageBody.Attributes.Add("onLoad", "location.href='#yourAnchor';")


    Thanks, Darrel. I was thinking that a named anchor was the way to go, but i'm
    still not getting it.

    I put in the following script:

    <script language="JavaScript">
    function ChangeFocus(){
    pageBody.Attributes.Add("onLoad", "location.href='#Results';")
    }
    </Script>

    But I can't figure out from where to call it. There really isn't a specific
    button handler for Dreamweavers implementation of this. I have this code right
    before the dataset code:

    <script runat="server">
    Sub Page_Load()
    If Not IsPostBack Then
    dgResults.Visible = false
    Else
    dgResults.Visible = true
    End If
    End Sub
    </script>

    I've tried calling the javascript from there, but keep getting errors. I just
    can't figure out what I'm doing wrong. Any other suggestions?

    Thanks,
    Jeff

    jeffpblues Guest

  6. #6

    Default Re: ASP.NET results page question

    > Thanks, Darrel. I was thinking that a named anchor was the way to go,
    but i'm 

    You call it on the BODY onload event. As I showed you above.

    In your codebehind, in your button handler, you attach the script to the
    BODY HTML control:

    pageBody.Attributes.Add("onLoad", "location.href='#yourAnchor';")
     

    Ah, yet another reason to dump DW if you are serious about .net

    DW just doesn't do .net like Visual Studio does, so you really should
    consider using VS.net

     


    Well, if you can assume that everytime there is a postback, that it's going
    to the results section, then just put the above code after your ELSE
    statement.

    -Darrel


    darrel Guest

  7. #7

    Default Re: ASP.NET results page question

    Thanks, Darrel. Yeah, I'm going to have to find time to get to know Visual Studio. Thanks for your suggestions.
    jeffpblues Guest

Similar Threads

  1. ASP Results Page
    By Sharky91 in forum Dreamweaver AppDev
    Replies: 4
    Last Post: June 29th, 12:56 PM
  2. results page hyperlinks
    By adon1 in forum Coldfusion - Getting Started
    Replies: 3
    Last Post: June 20th, 07:54 PM
  3. Sending search results to a results page..with asp
    By dan.how in forum Dreamweaver AppDev
    Replies: 1
    Last Post: May 26th, 04:18 PM
  4. SQL Query - Results from another PHP Page ?
    By Frank in forum PHP Development
    Replies: 3
    Last Post: July 16th, 03:07 PM

Bookmarks

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139