Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C# ASP ASP.NET Framework Firefox , +
i have a updatepane;
in this update panel is a panel
in this panel is a fileUpload and a Button
i do clicked on the fileupload and select a file,
and when click on the button return ""
in my button_click is this code:
button1.text= filaeupload1.filename;
why return null value?
 

my code is this:
<asp:panel ....>
 
<asp:updatepanel ....>

 
<asp:fileupload ....>
<asp:button ...onclick="clickonbutton">
 
br mode="hold" />
 
br mode="hold" />
and in "clickonbutton " is this code :
 
button1.text=fileupload1.filename;
 
this code always return null("")
 
when i do delete update panel from mproject is true and my project returned filename of selected file
 

in tha latest ,i want can only selectable jpg file
Posted 29-Jun-12 2:45am
Edited 29-Jun-12 3:13am
v2
Comments
ajay.anilmaddi at 29-Jun-12 7:48am
   
I cant understand Ur Problem,
Please improve Ur Question???
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

hi
 
i hope it will help you
 
Upload a image using file upload control in asp.net[^]
  Permalink  
Comments
sadegh_rusta at 29-Jun-12 8:27am
   
i want know why i cant insert a file upload in a update panel
because when i do it file uload cant get afilename
how i do it
sadegh_rusta at 29-Jun-12 8:38am
   
i want use file upload and button(save button) in the update panel
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

Hi,
 

After reading your comments what i understand is, you need to upload file Asynchronously. you can not use default Fileuploaded with Update panel to upload file. you need to use some thirdparty control for Asynchronous file uploading.
 
Read Asynchronous File Upload[^] Article. this may help you,
 
Thanks
-Amit.
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 3

use Trigger on Script Manager :
 
<asp:ScriptManager ID="sc1" runat="server">
         </asp:ScriptManager>
         <asp:UpdatePanel ID="u1" runat="server">
             <ContentTemplate>
 
// your content
 
</ContentTemplate>
                <Triggers>
                    <asp:PostBackTrigger ControlID="Submit" />
                </Triggers>
            </asp:UpdatePanel>
 

in Submit name give your Save or Submit button name.
 
This will help you.
  Permalink  
Comments
sadegh_rusta at 29-Jun-12 10:21am
   
i do this
but postback all of page content
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 4

use Trigger on Script Manager :
 
<asp:ScriptManager ID="sc1" runat="server">
         </asp:ScriptManager>
         <asp:UpdatePanel ID="u1" runat="server">
             <ContentTemplate>
 
// your content
 
</ContentTemplate>
                <Triggers>
                    <asp:PostBackTrigger ControlID="Submit" />
                </Triggers>
            </asp:UpdatePanel>
 

in Submit name give your Save or Submit button name.
 
This will help you.
  Permalink  
Comments
sadegh_rusta at 29-Jun-12 9:46am
   
where i do my fileupload
sadegh_rusta at 30-Jun-12 16:34pm
   
how is triggers tag?

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

  Print Answers RSS
0 OriginalGriff 587
1 Sergey Alexandrovich Kryukov 479
2 Maciej Los 305
3 BillWoodruff 220
4 Mathew Soji 195
0 OriginalGriff 7,356
1 Sergey Alexandrovich Kryukov 6,817
2 DamithSL 5,461
3 Manas Bhardwaj 4,946
4 Maciej Los 4,475


Advertise | Privacy | Mobile
Web03 | 2.8.1411023.1 | Last Updated 29 Jun 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100