Hi microcontroleur,
Please try the example below. I integrated the error message into the Validation Summary control.
- <%@ Page Language="C#" %>
-
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
- <html xmlns="http://www.w3.org/1999/xhtml">
- <head runat="server">
- <title>Untitled Page</title>
- </head>
- <body>
- <form id="form1" runat="server">
- <table border="1">
- <tr>
- <td>
- Name:
- <asp:TextBox ID="textBox1" runat="server"></asp:TextBox>
- </td>
- <asp:RequiredFieldValidator ID="RequiredFieldValidator1" ControlToValidate="textBox1"
- runat="server" ErrorMessage="please type your name"></asp:RequiredFieldValidator>
- </tr>
- <tr>
- <td>
- <CuteWebUI:UploadAttachments ID="UploadAttachments1" runat="server">
- <ValidateOption MaxSizeKB="1" />
- </CuteWebUI:UploadAttachments>
- <asp:RequiredFieldValidator ID="RequiredFieldValidator2" ControlToValidate="textBox2"
- runat="server" ErrorMessage="the file is too large!"></asp:RequiredFieldValidator>
- </td>
- </tr>
- </table>
- <br />
- <asp:Button ID="button1" runat="server" Text="Submit(start verification)" />
- <asp:ValidationSummary ID="ValidationSummary1" runat="server" />
- <asp:TextBox ID="textBox2" runat="server" Text="textBox2" Style="visibility: hidden"></asp:TextBox>
- </form>
- </body>
- </html>
-
- <script>
- function CuteWebUI_AjaxUploader_OnError(msg)
-
- {
- if(msg.indexOf("is too large")!=-1)
-
- {
- var textBox2=document.getElementById("<%= textBox2.ClientID %>");
- textBox2.value="";
- return false;
- }
-
- }
- </script>
Regards,
ken