Click here to Skip to main content
15,878,970 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
In my aspx page, I have added two instance of applicant.ascx with differentIds but when it renders it will render as identical Id for controls within those user controls. when validating with jquery It only validates for one ascx control. how do I resolve this? any one please
Posted
Comments
Sergey Alexandrovich Kryukov 29-Mar-12 21:36pm    
How can anyone resolve your problem without seeing where did you screw up?
--SA

1 solution

I have not screwed up anything. the validation rule works as expected for a ascx page. here is a steps you can reproduce the behaviour
create aspx page, add a ascx to it e.g.
ASP.NET
<uc5:usrapplicant id="usrApplicant1"  runat="server" xmlns:uc5="#unknown"></uc5:usrapplicant> and add another one
<uc5:usrapplicant id="usrApplicant2"  runat="server" xmlns:uc5="#unknown"></uc5:usrapplicant>

in this usercontrol create a control
ASP.NET
<input name="txtAddress1" type="text" id="txtAddress1" class="txtAddress1" size="40"  runat="server" />

and in jquery validation add a rule to make the field required.
when rendering in aspx there will be duplicate IDs i.e. txtAddress1, my question is how can I render class as txtAddress2 or something so that I could do my validations. based on those class. thank you
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900