Link to home
Start Free TrialLog in
Avatar of AJagadish
AJagadish

asked on

Radiobutton List with UpdatePanel not workign

Hello,

I am trying to do a simple thing here. I have a radiobutton list inside an update panel and when clicked on Yes it should display a user control which is also in the update panel. And when pressed no it should hide it .. now for some reason the images in the user control are not updated when I click yes... I have pasted the code .. hoping for some help..

I am trying this in the update panel to avoid a full page post back..

The rblistPhoto_SelectedIndexChanged method just makes the tblUpload visible or invisible in the code behind...

Although the control itself is displayed when clicked on Yes... the images in the control do not load...

hoping for some help...

Thanks,
Ashwin

<asp:UpdatePanel runat="server" ID="UpdatePnlPhotos"  >
	                    <ContentTemplate> 
	                    
	                       <asp:RadioButtonList  CssClass="norm"  runat="server" ID="rblistPhoto"  
                                RepeatDirection="Horizontal" AutoPostBack="True" 
                                onselectedindexchanged="rblistPhoto_SelectedIndexChanged">
	                            <asp:ListItem Text="Yes"  Value="Yes"></asp:ListItem>
	                            <asp:ListItem Text="No"   Value="No"></asp:ListItem>
	                      </asp:RadioButtonList>	
	                       <table class="norm" id="tblUpload" runat="server" visible="false"   border="0" cellspacing="0" cellpadding="0">

                                <tr>
	                                <td >
	                                  <uc1:UploadFiles ID="UploadFiles1" runat="server" />
	                                </td>	          
	                            </tr> 
                    	       
                            </table>
                    	                                          
                            </ContentTemplate>
                             <Triggers>
                                <asp:AsyncPostBackTrigger ControlID="rblistPhoto" EventName="SelectedIndexChanged" />
                            </Triggers>
	                </asp:UpdatePanel>

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of Alfred A.
Alfred A.
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
By the way, you can also do a partial-postback on the update panel programmatically by doing something like below.  This assumes that UpdateMode is set to "Conditional"

protected void rblistPhoto_SelectedIndexChanged(object sender, EventArgs e)
    {
            UpdatePnlPhotos.Update();
    }
Avatar of AJagadish
AJagadish

ASKER

Not working