Click here to Skip to main content
15,921,989 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
hi.
im useing ajax toolkit ajax file upload on my website...
i have handled the OnUpload compelete event to save the uploaded file to database here id the code:
C#
decimal result = (decimal)SqlHelper.ExecuteScalar(SqlHelper.CreateCommand("SavePhoto",
      CommandType.StoredProcedure,
      new SqlParameter("@fileName", e.FileName),
      new SqlParameter("@contentType", e.ContentType),
      new SqlParameter("@content", e.GetContents())
));

this.InfoLabel.Text = result.ToString();


i should have the id of inserted photo in result and display it on InfoLabel but it doesnt show and when i do a break point the value is set to Text property of Label but it dosnt display it..

thanks.
Posted
Updated 2-May-13 22:31pm
v3
Comments
RelicV 3-May-13 0:56am    
Hi RedSakura, this is what the ajax file upload is supposed to do. You've to take a button and have to use JS function onClientComplete and in that use the button.click() to perform refresh.
RedSakura 3-May-13 2:58am    
Can you please show me a sample code?

you should use fullpostback using trigger in updatepanel. because fileupload is not working in asynchronousmode
 
Share this answer
 
Hi RedSakura,

Please do get the files from the below link and do some work on it to make it work for your application.

http://ge.tt/4K7JFff

Thank you,
Vamsi
 
Share this answer
 
i found a better solution for this myslef.

i create a static propery of List<photo> and every time i upload a file i add properties of that list in session any time i need it i can loop through that list,,,

any way thank every one ^^
 
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