Ask a Question related to ASP.NET General, Design and Development.

  1. #1

    Default usercontrol refresh

    What's the best way to refresh a usercontrol using a parameter? My
    usercontrol is just a DataList that retrieves data from SQL in association
    with a public propterty.

    I click on a LinkButton in my main page (ASPX), but it still refreshes the
    entire page... I only want the UserControl to blink and come back with new
    data.

    What's the direction I should be looking at? Even if I do it via
    JavaScript, how would I refresh the UserControl using JavaScript?

    TIA,
    -roko



    Rob Koch Guest

  2. Similar Questions and Discussions

    1. Can we use a usercontrol inside a usercontrol
      hi group can we use a usercontrol inside a usercontrol. i mean can we use <%Register tagprefix..... src=....ascx%> in an ascx file. thanks in...
    2. Event not firing in usercontrol inside usercontrol
      I'm stumped on this problem. I've created a user control that dynamically creates 5 linkbuttons in the CreateChildControls method. Each of these...
    3. using refresh button on the menu bar to refresh two frames.
      All, I have an ASP site that uses frames two frames. (yes I should be using include files, but we started ou using frames so we have been stuck...
    4. Problem with refresh button breaking automatic refresh
      As a public service, I'm posting the solution to a problem I had. The bizarre thing is that I think this should have created an error. Instead, it...
    5. Use LoadControl to load a usercontrol but the webcontrol in the usercontrol can not AutoPostBack
      a uscontrol test.ascx have a dropdownlist web control the dropdownlist's AutoPostBack property is set "true" but when i use...
  3. #2

    Default usercontrol refresh

    My hunch is that this is not possible. Here's why:
    1 - JavaScript cannot trigger anything on the server. UC
    are run at the server. Therefore JS alone could not
    trigger anything for a UC to refresh.

    2 - UC ultimately get generated into regular HTML that is
    merged with the rest of your page, just look at the view
    source HTML from your browser. To re-generate the UC
    requires re-generating the entire page.

    In terms of solutions, would caching help out? Perhaps
    putting the UC in a sub-frame so that it still has its own
    page that refreshes?

    HTH,
    Tim Stall

    >-----Original Message-----
    >What's the best way to refresh a usercontrol using a
    parameter? My
    >usercontrol is just a DataList that retrieves data from
    SQL in association
    >with a public propterty.
    >
    >I click on a LinkButton in my main page (ASPX), but it
    still refreshes the
    >entire page... I only want the UserControl to blink and
    come back with new
    >data.
    >
    >What's the direction I should be looking at? Even if I
    do it via
    >JavaScript, how would I refresh the UserControl using
    JavaScript?
    >
    >TIA,
    >-roko
    >
    >
    >
    >.
    >
    Tim S. Guest

  4. #3

    Default Re: usercontrol refresh

    As a quick fix, what I did was load all those UCs that I need (3 images with
    links vertically on the right side), enclosed them all within their own div
    tags. So for 4 user controls, I have them all enclosed in 4 div tags. I
    used javascript to show/hide these div tags, i.e.
    document.getElementById("uc1").style.display = 'block'); or
    document.getElementById("uc1").style.display = 'none');

    I found this method thanks to this link:
    [url]http://www.webmatrixproject.net/Forums/ShowPost.aspx?tabindex=1&PostID=21175[/url]

    As it is done, three images shows up in the UC (as there's only enough room
    for it), but if I was to do some pagination in that datalist of images, I
    think I will be stuck, but otherwise, I'm OK for the time being...

    Still not a be-all, end-all solution, but worth working towards... :-)

    -roko

    "Tim S." <timstall@hotmail.com> wrote in message
    news:003901c34a2d$f53a0570$a501280a@phx.gbl...
    > My hunch is that this is not possible. Here's why:
    > 1 - JavaScript cannot trigger anything on the server. UC
    > are run at the server. Therefore JS alone could not
    > trigger anything for a UC to refresh.
    >
    > 2 - UC ultimately get generated into regular HTML that is
    > merged with the rest of your page, just look at the view
    > source HTML from your browser. To re-generate the UC
    > requires re-generating the entire page.
    >
    > In terms of solutions, would caching help out? Perhaps
    > putting the UC in a sub-frame so that it still has its own
    > page that refreshes?
    >
    > HTH,
    > Tim Stall
    >
    >
    > >-----Original Message-----
    > >What's the best way to refresh a usercontrol using a
    > parameter? My
    > >usercontrol is just a DataList that retrieves data from
    > SQL in association
    > >with a public propterty.
    > >
    > >I click on a LinkButton in my main page (ASPX), but it
    > still refreshes the
    > >entire page... I only want the UserControl to blink and
    > come back with new
    > >data.
    > >
    > >What's the direction I should be looking at? Even if I
    > do it via
    > >JavaScript, how would I refresh the UserControl using
    > JavaScript?
    > >
    > >TIA,
    > >-roko
    > >
    > >
    > >
    > >.
    > >

    Rob Koch Guest

Posting Permissions

  • You may not post new threads
  • You may 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