Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is ct100 and how do I rename it?

Tags:

asp.net

Working in .net 4.0, it still seems all my input controls have the attribute 'name', with a value that begins 'ct100$...'.

Is there any way to rename this?

I've gone all the way up the control hierarchy, and given each control an ID and set its clientidmode to 'Static' to no avail, even the 'earliest' controls on the page still inherit the prefix.

like image 222
maxp Avatar asked Aug 09 '10 14:08

maxp


2 Answers

This is the master page's ID. I change it by adding a Page_Init to my masterpage which sets its id:

Private Sub InitSub(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Init
    ID = "master"
End Sub

This ID is normally empty/null so when it renders it it generates an id (starting at ct100 and going up)

Like @Scott Stafford said, keep it short because it prefixes every client id on your page.

I use words like "mBio", "mHome", etc..

like image 58
Bob Fincheimer Avatar answered Sep 28 '22 07:09

Bob Fincheimer


Why rename it? You can, as @Bob Fincheimer describes, but so what? Also, if you DO rename it, keep the new name short, because that name shows up in all generated HTML and all POSTing variables hundreds of times, possibly enough to actually affect performance of your site.

like image 36
Scott Stafford Avatar answered Sep 28 '22 08:09

Scott Stafford