By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,302 Members | 1,760 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,302 IT Pros & Developers. It's quick & easy.

Deleting files on web server via browser - a specific problem

P: n/a
Hello,

this is a problem I came upon while building a site based on MCMS 2002 but
it's not strictly MCMS-oriented:
I have a page that displays a certain content in presentation mode but when
an editor clicks "Switch To Edit Site" in MCMS console on the page, the page
displays a different content, an interface that editor use for upload and
deleting files on the web server. There are no problems with the upload but
there is a problem with file deleting.

I built a DataGrid control that displays the file list and has a column with
checkboxes. Editor then marks the files for deletion with clicks on
checkboxes, clicks on a button and File.Delete() should do the job. Except
for the one thing: even the first rendering of the page (after clicking
"Switch To Edit Site") is a postback. Therefore, I cannot put DataGrid
binding event inside "If Not IsPostBack" because in that case nothing gets
displayed. If I put the binding event outside "If Not IsPostBack" clause,
then the DataGrid gets re-created each time the page is loaded and checked
checkboxes are annulated (emptied) and the informations about what boxes are
checked never go through to Button OnClick event. Therefore, there's no
program error but the effect is as if no checkboxes were being checked and
no files are deleted.

What to do?
Maybe some viewstate could preserve the informations?

Thank you,
Hrvoje
Nov 18 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.