views:

137

answers:

2

Hi

I have controls like Textbox, dropdown on my CustomerDetails.ascx partialview.

Now can we do JQuery validations on the user controls.

In the MainView, we use code like this.

<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Mvc.Master" Inherits="System.Web.Mvc.ViewPage>" %>

//JQuery validations

Customer Profile Main View

In the PartialView, we use code like this.

<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl" %>

Zip*
+1  A: 

Yes, you can.

JQuery validation purely work on the client side (html level), so it doesn't matter whether it's on the partial view or full view.

J.W.
+1  A: 

When you think of partial views in mvc, they're probably closer to PHP's include() than to webforms custom controls. So just think of it as plugging in html or javascript/jquery somewhere in the middle of the page :-)

David Archer