This is a migrated thread and some comments may be shown as answers.
Getting client side validation to work with Telerik MVC Window
3 Answers 132 Views
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Ozzy Knox
Top achievements
Rank 1
Ozzy Knox asked on 29 Nov 2010, 10:27 AM
Hi,

I am using a telerik mvc window extension that is triggered from a custom template link in a telerik mvc grid.  The window is modal and it contains a form for editing data. After successfully implementing client side validation using a standard html page, I have been trying to implement it in the telerik mvc window.  I have not been able to do so successfully.  Is this possible?  Does anybody have a working example of this?

Thanks
Ozzy

3 Answers, 1 is accepted

Sort by
0
jonathan
Top achievements
Rank 1
answered on 03 Jan 2011, 07:36 PM
Hi Ozzy (cool name BTW, are you the prince of darkness?)

Your issue is not a bug in the telerik controls.  This behavior exists in MVC2 validation framework.  I had the issue becuase I was loading a partial view via ajax (aka via the Telerik window control)  and wanted client side validation.


To fix the issue, After your AJax loads the content,  call this function:

function validationFixup() {
    Sys.Application.remove_load(arguments.callee);
    Sys.Mvc.FormContext._Application_Load();
}


0
Bill
Top achievements
Rank 1
answered on 08 Jan 2011, 07:36 PM
Hi, I'm in the same situation and tried to use the function but it didn't seem to work. Can you give more background on how you are using that function?

How are you loading the contents of your window? Is it on server-sdie or is it done via javscript after the page loads.
0
Niladri
Top achievements
Rank 1
answered on 10 Mar 2011, 01:26 PM
Add them
<script src="@Url.Content("~/Scripts/MicrosoftAjax.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/MicrosoftMvcAjax.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/MicrosoftMvcValidation.js")" type="text/javascript"></script>
Tags
Window
Asked by
Ozzy Knox
Top achievements
Rank 1
Answers by
jonathan
Top achievements
Rank 1
Bill
Top achievements
Rank 1
Niladri
Top achievements
Rank 1
Share this question
or