Solved

Radiobutton List with UpdatePanel not workign

Posted on 2010-08-12
3
523 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Having worked on larger scale sites, we found out that you are bound to look at more scalable solutions to integrating widgets, code snippets or complete applications and mesh them into functional sites, in any given composition. To share some of…
The Confluence of Individual Knowledge and the Collective Intelligence At this writing (summer 2013) the term API (http://dictionary.reference.com/browse/API?s=t) has made its way into the popular lexicon of the English language.  A few years ago, …
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…

911 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

21 Experts available now in Live!

Get 1:1 Help Now