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

Telerik Ajax controls with ASP.Net MVC 2 RC server/client validation

1 Answer 124 Views
UI for ASP.NET AJAX in ASP.NET MVC
This is a migrated thread and some comments may be shown as answers.
Aiyaz
Top achievements
Rank 1
Aiyaz asked on 19 Dec 2009, 11:04 PM
Hi,
Im trying to use telerik controls with ASP.Net MVC 2 RC.  Im trying to use the MVC dataannotations server/client validations on the form which has some telerik controls placed inside.  My problem is that MVC client validation stops working when I try to use the RADScriptManager with a html form tag. It seems like the MVC EnableClientValidation only works with use Html.BeginForm method because it wires up some flags in the background when its rendering the form tag.

When I place the RADScriptManager inside the Html.BeginForm and I get the RADScriptManager requires a form runat="server" error.
If i add a html form tag e.g <form id="frm" runat="server"> on the page and add scriptmanager then the Html.EnableClientValidation is not triggered.  Is there a way to make this work?
<%@ Page Language="C#" Inherits="ViewPage<ProductViewModel>" %>

<% Html.EnableClientValidation(); %>
<% using (Html.BeginForm()) { %>

  <%= Html.TextBoxFor(m => m.Title) %>
    <%= Html.ValidationMessageFor(m => m.Title) %>
  <%= Html.TextBoxFor(m => m.Price) %>
    <%= Html.ValidationMessageFor(m => m.Price) %>

    <input type="submit" />
<% } %>

1 Answer, 1 is accepted

Sort by
0
Georgi Krustev
Telerik team
answered on 23 Dec 2009, 09:09 AM
Hello Aiyaz,

I tried to reproduce the depicted issue, but no avail. Please examine it and let me know if I am missing something.

In general MVC client validation is not suppose to validate ASP.NET AJAX controls on the page.

Sincerely yours,
Georgi Krustev
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Tags
UI for ASP.NET AJAX in ASP.NET MVC
Asked by
Aiyaz
Top achievements
Rank 1
Answers by
Georgi Krustev
Telerik team
Share this question
or