ASP.NET Master Page Content Page's IDs all changed, breaking CSS based on original element IDs? Are you kidding me
问题 ASP.NET Master Page Content Page's elements all seem to be having their ID's changed or prepended by the ASP.NET page renderer. This breaks all CSS styles based on the original element IDs. Is this seriously how it works? If so, is there a way around it? 回答1: Yes, you can specify the ClientIDMode set it to static. examples : Client Side <asp:TextBox ID="TextBox1" runat="server" ClientIDMode="Static"></asp:TextBox> Code Behind TextBox txtBox = new TextBox(); txtBox.ID = "TextBox1"; txtBox