---
title: "Form's input element name in ASP .NET"  
description: "Form's input element name in ASP .NET"  
author: "Anonymous User"  
published: 2014-08-26  
updated: 2014-08-26  
canonical: https://www.mindstick.com/forum/2147/form-s-input-element-name-in-asp-dot-net  
category: "asp.net"  
tags: ["asp.net"]  
reading_time: 1 minute  

---

# Form's input element name in ASP .NET

I'm using JQuery [plugin](https://www.mindstick.com/articles/23236/institute-management-for-wordpress-plugin) that operates on name [attributes](https://www.mindstick.com/articles/13105/2-attributes-that-make-your-odoo-ecommerce-theme-productive-and-engaging) of form elements. I know that I can [access](https://www.mindstick.com/articles/12994/how-foreigners-can-access-blocked-websites-in-china) id [attribute](https://www.mindstick.com/blog/221/attributes-reflection) value by using:

"<%= myControl.ClientID %>"

What about name attribute? In html [source](https://www.mindstick.com/interview/840/what-happens-if-the-both-source-and-destination-are-named-same) I see that name & id differ from each other.

## Full code:

```
            $("form").validate({            rules: {                "<%= _FullNameTextbox.ClientID %>": {                    required: true,                    minlength: 2                },                "<%= _EmailAddressTextbox.ClientID %>": {                    required: true,                    email: true                }            },            messages: {                "<%= _FullNameTextbox.ClientID %>": {                    required: "Please enter your full name",                    minlength: "Your name must consist of at least two characters"                },                "<%= _EmailAddressTextbox.ClientID %>": {                    required: "Please enter a valid email address",                    email: "Please enter a valid email address"                }            }        });
```

It worked fine when control was on Page. But now, when I placed it inside [user control](https://www.mindstick.com/forum/294/problem-in-access-the-control-inside-the-user-control), id and name differ:

<input type="text" id="Container__EmailAddressTextbox" name="[Container](https://www.mindstick.com/forum/159610/how-to-connect-a-windows-container-to-a-service-running-on-localhost)$_EmailAddressTextbox" [class](https://www.mindstick.com/blog/165/generic-class-in-c-sharp)="[error](https://yourviews.mindstick.com/view/88527/fixing-quickbooks-error-4120-reinstalling-vs-repairing)">

So instead of using _FullNameTextbox.ClientID I have to access name attribute value

## Replies

### Reply by Sumit Kesarwani

Hi Ankita, \

The UniqueID property of your [control](https://www.mindstick.com/blog/197/asp-dot-net-repeater-control) will be used as its client-side name attribute, so you can write:

"<%= myControl.UniqueID %>"


---

Original Source: https://www.mindstick.com/forum/2147/form-s-input-element-name-in-asp-dot-net

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
