Validation Failed message not displayed

4 posts, 0 answers
  1. Murali
    Murali avatar
    13 posts
    Member since:
    May 2013

    Posted 05 Jun 2013 Link to this post

    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>
  2. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 06 Jun 2013 Link to this post

    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.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Murali
    Murali avatar
    13 posts
    Member since:
    May 2013

    Posted 06 Jun 2013 Link to this post

    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
  5. Plamen
    Admin
    Plamen avatar
    2734 posts

    Posted 10 Jun 2013 Link to this post

    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.
Back to Top