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
  •  | 
  •  

質問

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!

役に立ちましたか?

解決

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.

他のヒント

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

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top