How can I remove ctl00_Body_ from ctl00_Body_grvDocs_ctl45_hypDocNav in gridview's hyperlink [closed]

StackOverflow https://stackoverflow.com/questions/19139993

  •  30-06-2022
  •  | 
  •  

Domanda

I have auto ID set in asp.Net. My hyperlink's ID is way too big ctl00_Body_grvDocs_ctl45_hypDocNav How can I reduce the ID's length? I want to keep it auto but atleast make it a bit small.

Thanks!

È stato utile?

Soluzione

Investigate the ClientIDMode property: http://msdn.microsoft.com/en-us/library/system.web.ui.control.clientidmode.aspx

If you set ClientIDMode="Static", your id will match in the rendered HTML, but you have the opportunity to have hyperlinks with the same ID, which will break a lot of the features of ASP.NET PostBack. Check the link above and choose the setting right for you.

Altri suggerimenti

No, You can do it. The way the id is generated is all the parents are appended in the id, if you do it auto. That means your HyperLink which is hypDocNav is inside ct145 which inside a grvDocs and so on

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top