[RESOLVED] [2005] File Upload & Postback
Hi all,
I m having one strange problem with my page.
I am using simple Html button of type submit for postback.(I have checked my page doesn't have any javascript error as well as runat="server" tag.)
My page has one textbox and one file upload control (which is also of html input control of type file)
My problem is when i insert WRONG file path in fileupload control, page doesn't postback. However, it postback when i insert right file path.
NOTE THAT THIS ONLY HAPPENS TO SOME PAGES. NOT EVERY ONE HAVING THE SAME FUNCTIONALTY.
Thanks in advances
Re: [2005] File Upload & Postback
Are you saying sometimes the button click does not do anything at all or it postsback (form post) but no button click event code is run? How does this happen on more than 1 page but not others and do you have javascript validation that stops postback (your own or like a "required filed validator")?
If there is validators on the page and more than one button that "causeValidation=true" the upload button click could be causing validation to fail and not postback.
Re: [2005] File Upload & Postback
The fact that the page doesn't postback if an incorrect file path is entered is not a problem. It is more likely a by-design feature. No point in submitting something that isn't there after all.
Re: [2005] File Upload & Postback
Well, I am using pure Javascript to validate control not required field validator.
And suppose if it's an design problem then what make it not to do post back when only a path is incorrect. Bec'z i don't think page design are intelligent for file path.
Re: [2005] File Upload & Postback
A browser is an application like any other application on your machine. It can effectively do anything on your machine, but browsers are generally designed with specific behavior patterns in mind.
For example, password textboxes always display as asterisks, and in addition, when a page is 'reloaded', the password field entries usually disappear so that they cannot be viewed in source. That's a browser behavior (defined by standards of course, but that's not the point).
Now the case described above is similar. It isn't the page itself that has the intelligence, it is the software which interprets your markup. HTML itself doesn't do anything, it's a definition set. The browser is what is doing all the work.
Re: [2005] File Upload & Postback
Sorry for late reply,
Yes mendhak, i understood. May be bowser itself using some pattern matching. I noticed that if my fileupload path contains min. one slash at any place then it do postback, which i checked using Javascript easily.
Thanks mendhak. Great work.
Re: [RESOLVED] [2005] File Upload & Postback
Let's just pray for the future when, perhaps, standards will be as-one. :)