Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Radiobutton List with UpdatePanel not workign

Posted on 2010-08-12
3
Medium Priority
?
530 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:
Alfred A. earned 1500 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:Alfred A.
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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

The most up-to-date version of this article is on my Blog https://iconoun.com/blog/
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
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…
Suggested Courses

927 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