how can I access name attribute of fields in asp.net, I have used UniqueID and I was able to get the name of attribute but I have the form splitted in two different asp controls and I am not able to access the fields name attribute using UniqueID on other control.
for exmple..I have first name, last name in one control and credit card details in other control, I am using jquery validation plugins for validation which does the validation based on name attribute of field. I have the validation written in one control where I am using below code to get the name attribute
<%=txtFNameRoom.UniqueID%>
this validation works if I am putting the javascript in this control, I am not able to access the name attributes of credit cards fields which are on other control. I cannot break the validation in two parts because we can only initialize the .validate() method once. Anyone has any idea how can I get the name attribute of fields even though they are in different controls.
Perhaps there’s a better way, but this should work:
In your other control, expose a property:
Then, in the first control you can access that property: