Hi, i've prepared a form using Rad controls and i need to use 3 controls to Upload files. I had some first problem to validate these controls, solved using hidden fields that I value when a file is uploaded.
So when I press the Submit button (RadButton) the page is actually validated, but if there are problems on some other fields than RadAsyncUpload, the result is that the upload control loses the correct information on display.
I'm using Ajax, Telerik UI R2 2019, the jquery version i see is v1.12.4, Page_ValidationVer = "125";
I've read many discussions, but there's something wrong in my case.
I tried to intercept the validation in order to maybe implement something like this
but I can't, because if I try to call the function Page_ClientValidate it always returns TRUE.
Trying in debug i see that Page_Validators = undefined so the function exit with 'true'
The form submit correctly and server-side i see Page.IsValid property values but I need to perform the submit only where all fields are compiled or the asyncupload controls mantains their state after validation.
Could there be confusion between client and server validation?
Do you have any ideas? Thanks
8 Answers, 1 is accepted
Update: if i insert this line in web.config
validations seems to be performed on the clientside, (and the problems about upload controls is solved) except the radiobuttonlists, them are validated server-side generating the problem again
This article talks about jQuery troubleshooting, but i'm not sure of my environment...
i think I've created a Telerik Web Application but how can I verify this?
Also my RadScriptManager is void, only declared in the MasterPage.Master
The validation on the client for the RadioButtonList without a postback can be achieved only with CustomValidators: https://docs.telerik.com/devtools/aspnet-ajax/controls/radiobuttonlist/functionality/aspnet-validators-support#validation-on-the-client.
The <add key="ValidationSettings:UnobtrusiveValidationMode" value="None" /> key is needed for client-validation for projects with .NET framework version 4.5 and higher: http://stackoverflow.com/questions/16660900/webforms-unobtrusivevalidationmode-requires-a-scriptresourcemapping-for-jquery.
Here you can find information about the difference between the WebSite and WebApplication: https://stackoverflow.com/questions/398037/asp-net-web-site-or-asp-net-web-application. An easy way is to check the project icon as it is different for the web site and application.
Another thing is that the Web Application has CodeBehind property and aspx.designer.cs file for the web form while the Web site has CodeFile property and no designer files.
Regarding the persistence of the uploaded file across postbacks, you can check the following articles:
because my project make a single .dll and files has .aspx.designer.cs i understand that i'm using a web application.
Yesterday i've replaced the required validators with custom validators for radio button controls, and the client-side validation has worked.
this shuffled the cards and the problem about the persistence of the async upload state disappeared :-)
So right now the page is working properly.
Also my void RadScriptManager is this correct?
It is good to hear that everything is working now.
Regarding the RadScriptManager, the declaration as it is now is entirely functioning because all the necessary properties have already defined default values.
Sorry Still not understand,
Can give more simple demo?