Dynamic User Control Problem


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: Dynamic User Control Problem

  1. #1
    Join Date
    Nov 2005
    Posts
    2

    Dynamic User Control Problem

    hi I was curious if anyone has found the solution for Dynamically maintaining ViewState of the Loaded User Control.

    I have a RadioButtonList inside a Panel which is created during design time. Now depending on Option 1, 2 or 3, I am Dynamically Loading the UserControl1.ascx or UserControl2.ascx or UserControl3.ascx respectively.

    The problem is I have to select the option 1 twice to maintain and retreive its value (same for option 2 and 3, have to select it twice to gets its value)

    Can someone help with this with an example in VB.NET

    thanks

    - webc

  2. #2
    Join Date
    May 2005
    Location
    UK
    Posts
    278
    Page.RegisterHiddenField(this.UniqueID + "option", 1);
    where 1 denoted your user control 1

    Now when you select the options radiobutton list use javascript to update this field and retreive with a postback done at the end of the javascript function. I did this when i wrote custom server controls
    Sri

Similar Threads

  1. Replies: 1
    Last Post: 08-18-2005, 02:19 PM
  2. Replies: 0
    Last Post: 08-16-2005, 11:36 AM
  3. Problem with displaying the user control
    By npswarna_13 in forum ASP.NET
    Replies: 0
    Last Post: 06-27-2005, 07:09 AM
  4. Web User Control and javascript
    By s in forum ASP.NET
    Replies: 0
    Last Post: 03-26-2003, 03:17 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
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center