This is a migrated thread and some comments may be shown as answers.

Validation Failed message not displayed

3 Answers 194 Views
AsyncUpload
This is a migrated thread and some comments may be shown as answers.
Murali
Top achievements
Rank 1
Murali asked on 05 Jun 2013, 09:10 AM
Hello,

Am using the RadAsyncUpload. On OnClientValidationFailed am calling validationFailed script. But it doesn't show the message.Instead Something blinking near the file name. Kindly suggest

Note : Am using a Dropzone which is our requirement.

Thank you

My Code :


<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <script type="text/javascript">
        function validationFailed(sender, eventArgs) {
            $(".ErrorHolder").append("<p>Validation failed for '" + eventArgs.get_fileName() + "'.</p>").fadeIn("slow");
        }
    </script>
    <style type="text/css" runat="server">
 .DropZone1
{
    width: 300px;
    height: 90px;
    background-color:white;
    border-color: #CCCCCC;
    color: #767676;
    float: left;
    text-align: center;
    font-size: 16px;
    color: white;
}

 .qsf-demo-canvas h2 {
     margin: -10px -10px 10px;
     padding: .25em 40px;
     color: #ffffff;
     background: #ff6b2b url("img/header-bg.gif") 15px center no-repeat;
}

    </style>
</head>
<body style="background-color:#505D66">
    <form id="form1" runat="server">
    <table>
        <tr>
            <td>  
                <div id="div1" class="qsf-demo-canvas">
          <h2>Upload files</h2>         
                <telerik:RadScriptManager ID="RadScriptManager1" runat="server"></telerik:RadScriptManager>             
                <telerik:RadAsyncUpload ID="RadAsyncUpload1" runat="server" MultipleFileSelection="Automatic" AllowedFileExtensions="jpg" OnClientValidationFailed="validationFailed" DropZones=".DropZone1"></telerik:RadAsyncUpload>
                <div class="DropZone1">               
                <p style="color:black">Drop Files Here</p>
                </div>                   
            </td>
        </tr>
    </table>
    </form>
</body>
</html>

3 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 06 Jun 2013, 05:03 AM
hi,
I have tried the following code to achieve the scenario and it worked as expected on my end.
ASPX;
<telerik:RadAsyncUpload runat="server" DropZones="div1" ID="RadAsyncUpload1" AllowedFileExtensions="jpg" OnClientValidationFailed="OnClientValidationFailed">
</telerik:RadAsyncUpload>
<div id="div1" style="width:200px;height:50px;background-color:Gray">
</div>

JS:
function OnClientValidationFailed(sender, args)
 {
  var fileExtention = args.get_fileName().substring(args.get_fileName().lastIndexOf('.') + 1, args.get_fileName().length);
  if (args.get_fileName().lastIndexOf('.') != -1)
    {
//this checks if the extension is correct
  if (sender.get_allowedFileExtensions().indexOf(fileExtention))
   {
     alert("Wrong Extension!");
   }
  else
   {
    alert("Wrong file size!");
   }
  }
  else
  {
    alert("not correct extension!");
  }
}

Thanks,
Shinu.
0
Murali
Top achievements
Rank 1
answered on 06 Jun 2013, 05:44 AM
Hi shinu,

Thanks for your reply

If i drag and drop a file into the dropzone, it gives a message

1) Log in as Super Admin- Click on any user to edit- Click on the Phone text box- By default the error message appears.

2) Log in as super Admin-  Click on any user to edit- Click on Submit- 'This e-mail address is already in use. Try another.' message appears.

3)  Admin must be able to change the Password.

4) After logging out, Clicking on backspace still Keeping the user logged in. Kindly check.

5) Without selecting an user, click on delete. The error message should be displayed. Intead confirmation pop up getting displayed.

6) Alignment changes in IE9. Kindly check.
  

New
****
1) Confirm password should be mandatory

	2) Clicking on Reset displays error page ( happens in Super Admin)

	3) Clicking on Reset should not display the error message.(Phone number)

4) Log in as Super Admin- Click on any user to edit- Click on the Phone text box- By default the error message appears.

5) LOg in to Super Admin. Click on Sign Out. Then Log in to Employee. By clicking back button am able to access Super admin.

6) Click on Save password on Chrome. Then clcik on Add User. The user credentials are displayed. Kinldy check.

	7) Same Email ID cannot be carried for different accounts with different roles.

	8)  Without selecting an user, click on delete. The error message should be 	displayed. 	Intead confirmation pop up getting displayed. message should be 'Select atleast 	one user'

	9) Unable to delete any user. Displays error message 'Super Admin account cannot be deleted'

	10) No delete option should be displayed for employee account

11) After searching a particular status or role or employment type or user name, the sorting should revolve around that particular alone. Should not display the entire list. kinldy check

----------------------------------------------------------------------------

kindly suggest

thank you
0
Plamen
Telerik team
answered on 10 Jun 2013, 08:56 AM
Hi Murali,

 
The points provided does not look related to RadAsyncUpload. Please let us know if you have any further issues with it and let us know if any of them can be reproduced on any of our on-line demos.

Regards,
Plamen
Telerik
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
Tags
AsyncUpload
Asked by
Murali
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Murali
Top achievements
Rank 1
Plamen
Telerik team
Share this question
or