ASP.NET automatically changes input element name to ctl00$ContentPlaceHolder

Asked 1 years ago, Updated 1 years ago, 52 views

The reason is that you are using the master page.
"It was written on an overseas website that ""ClientIDMode="""Static" would be fixed by writing ""ClientIDMode="" in the ContentPlaceHolder."
But writing this doesn't fix it.

I wrote the page directives on the master page, the attributes of the ContentPlaceHolder element, the asp:Content element attribute on the content page, and even the attributes of the input element of the target, but it didn't fix it.

Is there something wrong with the solution?

c# .net asp.net

2022-09-30 11:49

1 Answers

Because the UniqueID property corresponds to the name attribute, the ClientIDMode setting does not affect the name.
The ClientID property is printed in the id attribute.


2022-09-30 11:49

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.