c# - Asp.net button onclick not working in updatepanel -


my problem is, asp button's onclick not working inside updatepanel. code is, have asp fileupload control upload file. , afterwards, user can click button , filename of uploaded file displayed in asp label control.

but when tried it, not displaying filename in label. nothing.

here aspx:

   <asp:updatepanel runat="server" updatemode="always" id="updpnlname"      childrenastriggers="true">                          <contenttemplate>                               <asp:fileupload runat="server" id="image1"/>                                    <asp:button id="button2" runat="server"                                      text="upload" onclick="button2_click"/>                              </contenttemplate>                             <triggers>                                <asp:asyncpostbacktrigger controlid="button2"                                      eventname="click"/>                              </triggers>                      </asp:updatepanel>                      <asp:label id="label3" runat="server" text="label">   </asp:label> 

here code-behind:

public void button2_click(object sender, eventargs e) {     var filename1 = image1.filename;     label3.text = "upload successfull - " + filename1; } 

by way, reason why wanted use updatepanel avoid refreshing entire page when user clicked button. please kindly me on one.

place label inside updatepanel, should update label control's text value.


Comments

Popular posts from this blog

PHP and MySQL WP -

android - InAppBilling registering BroadcastReceiver in AndroidManifest -

go - golang pprof for c library code -