Solved

Radiobutton List with UpdatePanel not workign

Posted on 2010-08-12
3
522 Views
Last Modified: 2012-05-10
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

0
Comment
Question by:AJagadish
  • 2
3 Comments
 
LVL 21

Accepted Solution

by:
Alfred1 earned 500 total points
ID: 33426398
Try setting UpdateMode property to "Conditional"


<asp:UpdatePanel runat="server" ID="UpdatePnlPhotos"  UpdateMode="Conditional">


http://codeclimber.net.nz/archive/2007/05/24/updatemode-default-value-for-the-updatepanel-is-always.aspx
0
 
LVL 21

Expert Comment

by:Alfred1
ID: 33426427
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();
    }
0
 

Author Closing Comment

by:AJagadish
ID: 33580777
Not working
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

This article discusses the difference between strict equality operator and equality operator in JavaScript. The Need: Because JavaScript performs an implicit type conversion when performing comparisons, we have to take this into account when wri…
This article discusses how to create an extensible mechanism for linked drop downs.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now