Using jquery with nested masterpages

Posted by diver-d on Stack Overflow See other posts from Stack Overflow or by diver-d
Published on 2010-05-16T05:11:51Z Indexed on 2010/05/16 5:20 UTC
Read the original article Hit count: 292

Filed under:
|
|

Hi everyone,

Can anyone show me how to use jquery in an asp.net nested masterpage. I have my main masterpage where I have added the link to the jquery libaray and also the validation framework. I have then created another masterpage with some styling and created a aspx page based on that masterpage.

How can I attach the validation framework to textboxes within my page?

I have tried

         $("#aspnetForm").validate({
            rules: {
                <%=txtPostCode.UniqueID %>: {
                    minlength: 2,
                    required: true
                },
                 <%=txtContactEmail.UniqueID %>: {                        
                    required: true,
                    email:true
                }
            }, messages: {
                <%=txtPostCode.UniqueID %>:{ 
                    required: "* Required Field *", 
                    minlength: "* Please enter atleast 2 characters *" 
                }
           }
        });

However nothing happens. Can anyone point me in the right direction?

© Stack Overflow or respective owner

Related posts about ASP.NET

Related posts about jQuery