asp fileupload control..unable to display the text from the database
I added an asp file upload control and was trying to upload the image successfully..cool.
i am adding the location of the image in the columns of a sql server table ~/yourwwwlocation/yourimagefolderlocation
now when I load the page to edit i need the ~/yourwwwlocation/yourimagefolderlocation in the file upload text box, well, i was unable to set the as its a read only property.. fileupload.postedfile = “read only doesnt work”;
well the work around was to add the hidden field on the page and then in the code behind writing the logic to find
whether the database table column has a location text in it,
if it has, pass it as it is., dont process
and if the database table column has a text and u are trying to upload a new file..
then check whether the hidden value matches with the new value..
if it doesn’t process(upload it) .
if there is nothing in the database field and its new upload,( hidden value = “”)
it will upload
Hope this helps…
Posted: August 18th, 2008 under asp.net.
Tags: asp, asp.net, file upload, fileupload