Click here to Skip to main content
15,891,905 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am unable to upload a file in the following that has an UpdatePanel. Ofcourse when it is outside updatepanel I am able to do it through the showbutton_click and able to see the image.

XML
<asp:UpdatePanel ID="UpdatePanel3" runat="server" >
<ContentTemplate>
<asp:Panel ID="Panel117" runat="server"
 style="border-width: 1px; border-style: solid; top: 1475px; left: 125px; position: absolute; height: 161px; width: 279px; background-color:InactiveBorder; border-color:Black">
 <asp:Image ID="ImagePreview" runat="server" Height="97px" Width="99px"  style="z-index: 1"/>
            <asp:FileUpload ID="PhotoUpload" runat="server"
            style="z-index: 1; left:100px; top: 53px; position: absolute; height: 46px; width: 218px; right: 90px;" />
<asp:Button ID="Button7" runat="server" CausesValidation="False"  onclick="Showbutton_Click"
            style="z-index: 1; left: 7px; top: 123px; position: absolute" Text="Show" />
</asp:Panel>
</ContentTemplate>
 <Triggers>
           <asp:PostBackTrigger ControlID="Button7" />
           </Triggers>
 </asp:UpdatePanel>
Posted
Comments
S.Rajendran from Coimbatore 14-Nov-14 10:41am    
helpless!!

1 solution

<asp:postbacktrigger controlid="Button7" xmlns:asp="#unknown">

I think you need the eventname="click" in the trigger'

Or because the button is inside the update panel, the ID name is prefixed with something like $CT_100_button7

Try in the button
<asp:button xmlns:asp="#unknown">
ID="Button7" 
ClientIDMode="Static" 
runat="server" 
CausesValidation="False"  
onclick="Showbutton_Click"
style="z-index: 1; left: 7px; top: 123px; position: absolute" 
Text="Show" />
</asp:button>


http://msdn.microsoft.com/en-us/library/system.web.ui.control.clientidmode%28v=vs.110%29.aspx[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900