Dynamic refresh of a UserControl

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • oaksong

    Dynamic refresh of a UserControl

    I have an embedded user control based on TreeView that I would like to
    refresh dynamically.
    The control is in a <div that's hidden until a specific selection
    has been made. Unfortunately the control has already been populated by
    the time the user makes the selection, with all of it's info buried in
    the State.

    I've done quite a bit of research at this point and I'm not finding
    this specific functionality. I'm not looking to refresh a couple
    nodes, I need to replace the entire tree.

    I've looked at controls.add, but that fails with the well known
    "Controls collection cannot be modified <%...%>" error.

    The page has several UC's which have the standard <%@ reference at the
    top of the page. I'm guessing that this is what's causing the problem
    as there are no <%='s anywhere.

    If someone could point me in a good direction I would much appreciate
    it. I've already spent a day on this and it seems like something that
    would be rather common place.

    tia
    Chris
  • Cowboy \(Gregory A. Beamer\)

    #2
    Re: Dynamic refresh of a UserControl

    If you need the data to update, you will either have to take a trip to the
    server (page refresh) or use something like AJAX. If you want this to appear
    seemless, AJAX is your better option. Between the AJAX bits in VS 2008 (or
    added to VS 2005) and the AJAX Toolkit (downloadable from codeplex), you can
    even build in the visibility aspect.

    --
    Gregory A. Beamer
    MVP, MCP: +I, SE, SD, DBA

    Subscribe to my blog


    or just read it:


    *************** *************** *************** ****
    | Think outside the box!
    |
    *************** *************** *************** ****
    "oaksong" <oaksong@hotmai l.comwrote in message
    news:dfc8e7f8-5077-4e22-a6d2-c2448a5fe6a6@k1 3g2000hse.googl egroups.com...
    >I have an embedded user control based on TreeView that I would like to
    refresh dynamically.
    The control is in a <div that's hidden until a specific selection
    has been made. Unfortunately the control has already been populated by
    the time the user makes the selection, with all of it's info buried in
    the State.
    >
    I've done quite a bit of research at this point and I'm not finding
    this specific functionality. I'm not looking to refresh a couple
    nodes, I need to replace the entire tree.
    >
    I've looked at controls.add, but that fails with the well known
    "Controls collection cannot be modified <%...%>" error.
    >
    The page has several UC's which have the standard <%@ reference at the
    top of the page. I'm guessing that this is what's causing the problem
    as there are no <%='s anywhere.
    >
    If someone could point me in a good direction I would much appreciate
    it. I've already spent a day on this and it seems like something that
    would be rather common place.
    >
    tia
    Chris

    Comment

    • oaksong

      #3
      Re: Dynamic refresh of a UserControl

      On Mar 28, 10:50 am, oaksong <oaks...@hotmai l.comwrote:
      I have an embedded user control based on TreeView that I would like to
      refresh dynamically.
      The control is in a <div that's hidden until a specific selection
      has been made. Unfortunately the control has already been populated by
      the time the user makes the selection, with all of it's info buried in
      the State.
      >
      I've done quite a bit of research at this point and I'm not finding
      this specific functionality. I'm not looking to refresh a couple
      nodes, I need to replace the entire tree.
      >
      I've looked at controls.add, but that fails with the well known
      "Controls collection cannot be modified <%...%>" error.
      >
      The page has several UC's which have the standard <%@ reference at the
      top of the page. I'm guessing that this is what's causing the problem
      as there are no <%='s anywhere.
      >
      If someone could point me in a good direction I would much appreciate
      it. I've already spent a day on this and it seems like something that
      would be rather common place.
      >
      tia
      Chris
      To clarify:

      I'm using a dropdownlist to fire a postback, however I've discovered
      that the UC refreshes before the click event for the dropdownlist gets
      fired.

      I need to set some session variables, but I need to know which
      dropdownlist control was fired.

      Comment

      Working...