Solved

Radiobutton List with UpdatePanel not workign

Posted on 2010-08-12
3
527 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Salesforce Has Never Been Easier

Improve and reinforce salesforce training & adoption using WalkMe's digital adoption platform. Start saving on costly employee training by creating fast intuitive Walk-Thrus for Salesforce. Claim your Free Account Now

Question has a verified solution.

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

Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
This article discusses how to implement server side field validation and display customized error messages to the client.
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

626 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