.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
david stephan
Gaurav Pal
Post New Web Links

update datalist in updatepanel after asyncfileupload has uploaded a new file

Posted By:      Posted Date: October 04, 2010    Points: 0   Category :ASP.Net

I want to update an updatepanel after the user has uploaded a photo via the asynfileupload control.

Below is my current code. I also tried setting updatemode="conditional" to "false" and then in code-behind call upnlPhotos.update, but without luck...

Upload photo: <cc1:AsyncFileUpload ID="afuPhoto" runat="server" /><br />

<asp:UpdatePanel ID="upnlPhotos" runat="server">

    <asp:DataList ID="dlPhotos" DataSourceID="dsPhotos" DataKeyField="id" RepeatColumns="5" RepeatDirection="Horizontal" GridLines="None" runat="server" >
        <img alt="" src='/images/trouwlocatiefotos/thumbs/<%# Eval("locpath")%>' /><br />            

    <asp:SqlDataSource ID="dsPhotos" SelectCommand="SELECT id,locationid,locpath from location_photos lp where locationid=@locationid" ConnectionString="<%$ConnectionStr

View Complete Post

More Related Resource Links

AsyncFileUpload is not uploading the file



I have added AsyncFileUpload to creata user wizard control. When I tried to upload the file this control seemed to work fine and show confirmation at the end. But when I checked the website no file has been uploaded at all.

Here is the code, please let me know why its not uploading the files/images

<asp:ToolkitScriptManager ID="ScriptManager1" runat="server"></asp:ToolkitScriptManager>
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<asp:CreateUserWizard ID="CreateUserWizard1" runat="server"  
 FinishDestinationPageUrl="~/MyPage.aspx"                                     LoginCreatedUser="False" CreateUserButtonText="Add" oncreateduser="CreateUserWizard1_CreatedUser1" 
<asp:CreateUserWizardStep ID="CreateUserWizardStep1" runat="server" >
<asp:WizardStep ID="WizardStep1" runat="server" Title="Set preferences">
<asp:AsyncFileUpload ID="AsyncFileUpload1" runat="server" ThrobberID="spanUploading" OnClientUploadError="

file upload in Create User Wizard Created User event with UpdatePanel Tag wont work?



In my Create User Wizard1 Created User Wizard Event, I am collecting extra information from text boxes and allowing

the user to uplad a file.



I have put the Submit button within an Update Panel Tag but since I have done this it does not work.

Is there a way round it. In this situation would you use a trigger.?


<br />

  <asp:UpdatePanel ID="UpdatePanel2" runat="server">

  <asp:Button ID="StepNextButton" runat="server"  CommandName="MoveNext"  align="middle"
                                            Text="Submit my Profile" />

Update Profile Database from text file using BDC



I have a requirement to import the profile properties from a text file in sFTP to update the MOSS Profile Database. The objective is to create a single repository for the Staff Directory in MOSS.

Can I use BDC to connect and update the Profile database?

What is the alternate approach?


Run a javascript function after UpdatePanel.Update()


I thought that adding the javascript within the ContentTemplate would cause it to run every time the UpdatePanel was updated.  For example, I would assume that for the following:

<atlas:UpdatePanel ID="UpdatePanel1" runat="server" Mode="Conditional" >
        Hello from inside the update panel!!!!
        <asp:Button ID="foo" runat="server" OnClick="foo_Click" Text="Click me to postback!" />
        <script type="text/javascript">alert('Javascript, baby!');</script>

 would cause the function alert() to run every time the UpdatePanel returns from the button click.  This is not the case, however.

How do I do this?  My update panel contains a scrolling Div and I

How to initiate a file download from withing UpdatePanel?

Hi all, I'm building dynamically a series of ImageButton controls, and I want to assign them a hyperlink for downloading files. So say you got a dropdownlist of 3 items 1,2 and 3, if you select 1 it creates one imagebutton and pointrs to fileA, if you select 2 it creates two imagebuttons and the first one points to fileA and the second one to fileB and so on... Everything is wrapped in an UpdatePanel to avoid postbacks. I have a problem binding the download link in the ImageButton.navigateurl, and then downloading it. I don't know how to do it...   protected void Button1_Click(object sender, EventArgs e)    {        Panel myPanel = (Panel)UpdatePanel1.FindControl("Panel1");             string[] Uploaders = new string[CheckBoxList1.Items.Count -1];        for(int i = 0; i < CheckBoxList1.Items.Count; i++)        {            if(CheckBoxList1.Items[i].Selected)                  Uploaders[i] = CheckBoxList1.Items[i].Text;         }              my

Update progress within a datalist

I have an update panel and then a datalist and then a nested datalist...it looks like this:   <update panel>      <datalist1>            <datalist2>            </datalist2>      </datalist> </updatepanel>   Problem is, within datalist 2, I have some linkbutton's and I'd like to show a progress "gif" (update progress) when the button is clicked.  I can create the update progress, but when you click the button, you get the "gif" shown for every item in the nested datalist.  Anyone know how I can identify where I am in the datalist (which linkbutton) and only show the progress "gif" for that button? Thanks in advance for any help! Mike    

Cannot read stream from uploaded file

I have a file upload which uploads a file and gets read into a byte array.int FileLength = File1.PostedFile.ContentLength; if (File1.PostedFile != null && File1.HasFile) { Stream fStream = File1.PostedFile.InputStream; byte[] contents = new byte[fStream.Length]; fStream.Read(contents, 0, (int)fStream.Length); fStream.Close(); fStream.Dispose(); The problem is, the fStream.Read seems to have a problem reading the stream. When I debug it, and the value of "contents" appears to be empty. The file gets uploaded as a corrupted file.  

How long will it be marked as New for an uploaded file?

Hi there, A simple question: how long will it be marked as new when a file is uploaded or created to a library? Thanks.  allan

user.identity.name="0" when uploading file using ajaxToolkit:AsyncFileUpload

hi, i am using AsyncFileupload to upload user picture. after the picture is uploaded and saved i opened another page and i noticed that the user.identity.name is lost. any idea 

Update updatepanel

Hi,I have user control in my page and i want to update updatepanel on this user control when click on linkbutton on my page.*notice: linkbutton is not inside of user control.

event receiver to update created field of uploaded document

Hi,   I need to update the created column with the document creation time . 1) First should i use ItemAdding event or Item Added event 2) how do i get the file created properties and assign it to the cdocument library created column.

How can i delete the file uploaded in my web page?

 Hi Experts. I am writing a simple web page that  users can upload an image file. After the file is uploaded, Users can fill up  other question in the web page. then users click the submit button to register them and the file is uploaded previously is move to special folder and is saved there. Know i want to delete the uploaded file if the user upload the file but dont click the submit button and close the web page. because i dont need the file uploaded until the user is not registered. I use Session_End event but i dont know why it dont work. With Regards. Mojtaba

File upload control and update panel ... ab-normal behavior?

 I have two update panels on single page . 1st one contain drop down and some other controls. I have used asyncpostbacktrigger in 1st update panel.  while in second PostBackTrigger (because of file upload). When page loads , it first dislays the content of 1st udate panel, when I click button to show the content of 2nd update panel , its contents are not displayed. look at this code, it demonstrates what I mean to say. <asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional"> <ContentTemplate> <asp:panel ID="pnl" runat="server"> <asp:DropDownList ID="drpdwn" runat="server"> <asp:ListItem>Item 1</asp:ListItem> <asp:ListItem>Item 2</asp:ListItem> </asp:DropDownList> </asp:panel> <asp:Button ID="lnkbtnNext" runat="server" Visible="false" onclick="Button1_Click" Text="Next" /> </ContentTemplate> <Triggers> <asp:AsyncPostBackTrigger ControlID="lnkbtnNext" /> </Triggers> </asp:UpdatePanel> <asp:UpdatePanel ID="updpnl3" runat="server" UpdateMode="Conditional"> <ContentTemplate> <asp:PlaceHolder ID=&qu

File Upload Control is not working in Update Panel

hi friend... i am using update panel... in one of my aspx page (ASP.NET 2.0)there is a file upload control in update panel which is used to upload company logo on server..when i remove the update panel.. than file upload is working properly..but when i again place an update panel then file upload control is not working and its giving me error.. in likeIf String.IsNullOrEmpty(fldLogo.PostedFile.FileName.ToString) Then                 as object reference not set to an instance of an object... can any body help me ?any idea ??  

Sdf file doesn't update once the application close

     i have configured for data sync setup using configure data synchronization wizard, then deploy the application in emulator. while run the application the data has synched back and forth from client to server on two way sync.  once application get closed the sdf.file is only having  existing data which is same as we got end point of configuration. we can view the updated data while run the application. but we restart application we didn't have the updated and newly inserted data . i don't know what i missed in config. it would be great help if anyone guide me.

how to periodically update database file of my wpf application?

Hi, I have a WPF Windows application which we distribute to our clients. The application consists of some database table which changes every month. eg. the application users a  exchange rate table which is valid for one month. What is the best approach to update the data in these table. Please note that the whole application is not changing but only the data in it changing. Please guide me with some options how I can achieve this task. Thank You. Mohamed Ziyad

uploading a file with wcf works fine with local drive, but only 4096 kb uploaded when I use unc stor

Hello I'm writing a wcf service for uploading files to a server. It works fine when I try to upload the file to the servers local c:/ drive, but if I use a UNC path only 4096 kb is stored. It actually looks like part of the file is lost while storing it with writeStream.Write(buffer, 0, bytesRead);, because I wrote the bytesread to an sql table and the number of elements are always the same no matter how many times I upload the file, but the stored file is always different sizes, ranging from 1996 kb to 4092 kb.   I'm using IIS 7.5 on a windows 7 enterprise machine. My IIS is using a administrator account for the application pool, so it should not be a problem with permissions.   My wcf method uses Stream to upload the file in chunks    public void UploadFile(RemoteFileInfo request)         { //some methods to set the filepath                                   int chunkSize = 4096;                                 byte[] buffer = new byte[chunkSize];                                 Stream writeStream = new FileStream(filePath, FileMode.CreateNew, FileAccess.Write);  &
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend