If you want to select a particular element to get the value or to process it, first you would select that element by id — as no two elements can have the same id in a valid HTML. Let us assume you have the following ASP. Net TextBox server control in your WebForm. Net server controls.
In the above ASP. Net server control, we have given the ID attribute value as txtName. The generated id value does not need to be same as that of this ID value. Before seeing the available options of selecting the element by id, let us revisit some of the fundamentals so that it would be easier to understand. Net code executed at the server side. Net server control. When you pass a string starting with , it means that you are passing the id to identify the element the id is the string followed by.
You can make the ASP. Now, the generated id will be txtName only — the same value that we give in ID attribute. Net server control- txtName in our case. This clientMode property is introduced from. Net framework 4. So you cant use this option in previous versions of.
When you access ASP. Net web page, following are the sequence of events happen at high level User request the ASP. Net Web page by typing the URL. The request is forwarded to the web server. If you have used ClientID like below , the generation of id value happens at this step.