Display user controls

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • jalicej
    New Member
    • Jul 2007
    • 6

    #1

    Display user controls

    am working on a C# web application.

    I have a web page in which i have the same user control placed in two columns of a table side by side.

    <table width=100% >

    <tr><td width=50%> <uc1:CtrlSatisf actionAverage ID="CtrlSatisfa ctionAverage1" runat="server" OnLoad="CtrlSat isfactionAverag e1_Load" /></td>

    <td width=50%><uc1: CtrlSatisfactio nAverage ID="CtrlSatisfa ctionAverage2" runat="server" OnLoad="CtrlSat isfactionAverag e2_Load" /></td></tr>

    </table>

    On loading this page i need to pass different parameters to each usercontrol and compare the report shown in each user control.

    In the user control there is a treeview and a button. When i select the treenodes and click the button of the usercontrol CtrlSatisfactio nAverage1 only CtrlSatisfactio nAverage1 is to be reloaded. And when i select the treenode of CtrlSatisfactio nAverage2 and click the button only CtrlSatisfactio nAverage2 has to be reloaded.

    How can i do this. When both user control are placed in the table and the button of CtrlSatisfactio nAverage1 is clicked the whole page is reloaded ie both the user control is reloaded.

    If i use a iframe can i call a user control in it and pass values to the user control. Is is there any other way to do this?
  • Shashi Sadasivan
    Recognized Expert Top Contributor
    • Aug 2007
    • 1435

    #2
    An easy way is to keep the controls in the SatisfactionAvg 1 as public ,
    and use the event handler of the tree node implemented in your main page. So when that triggers, your main page(which contains the controls) has access to the second usercontrol, and can send the parameter to it, and reload the control.

    However if you can create a eventhandler which can be implemented from the main page, that would be a better implementation.

    Comment

    Working...