I have an espaçay form in which the user has a series of input and then there is a submit button that gives the package information and email Sends parsed data and any attachments
I am using an ASP: To upload a file for the user, attach the file to the email, and click on the button, it hits a method that was written in Codebehind Checks to make sure all the required fields were populated, if not, then I kick an error message popup and first fails the required fields. The problem after pushback loses the attachment so I need to check my field client side and my background is in C ++ so scripting is new to me. Any help is appreciated.
Part of my form for visual reference:
Showing that I am currently dealing with the error
Upload file on postback will be cleared; It can not be stopped. But there are proceedings.
-
First of all, if possible, add the required Viaductors to check the missing data on the client side before submitting the form.
& lt; Asp: textbox id = "text1" text = "enter a value" runat = "server" /> & Lt; ASP: Required Field Wizard ID = "Expected FieldWidder 1" Control-Controller = "Lesson 1" Text = "Required Field!" Runat = "server" /> & Lt; ASP: Button ID = "Button 1" Runat = "Server" Text = "Valid" /> & lt; Asp: validationsummary id = "valsum" displaymode = "bulletlist" runat = "server" headertext = "You must enter a value in the following fields:" />
You can also type some javascript to the auto-focus you are looking for.
- If you really need to submit the form and validate on Codebehind, save the post file to the server with a random file name in a temporary folder. Update the hidden label or viewstate on the form with the filename so that you can return the file from the file on the next postback. You can hide the upload control and replace it with the "File {name} ready to upload" and a button with the "Upload a different file" label.
Note: The actual file content will not be good for display in the viewstate or session.
No comments:
Post a Comment