Asp. Net Element ID Inconsistency of Personal Summary after Applying Master Page

  • 2021-11-01 02:48:58
  • OfStack

In the content page, in this tab pair:


<asp:Content ID= " content "  ContentPlaceHolderID= " MainContent "  runat= " server " >

</asp: Content >

1. ID changes of form.


<form id= " form1 "  runat= " server " >

<form name= " aspnetForm "  method= " post "  action= " r_Balance.aspx "  id= " aspnetForm " >

2. Web server control changes: ID is prefixed with ct100_MainContent_. The name attribute is prefixed with ct100 $MainContent $. As shown below:


<asp:Label ID= " lbPagename "  runat= " server "  SkinID= " title "  Text= Balance Statistics >

</asp:Label>

<span id= " ctl00_MainContent_lbPagename " > Balance statistics </span>

--------------------------------------------


<asp:ImageButton ID= " btnPrint "  runat= " server "  SkinID= " b_print "  OnClick= " btnPrint_Click "  />

<input type= " image "  name= " ctl00$MainContent$btnPrint "  id= " ctl00_MainContent_btnPrint "  onclick= " return np(); "  />

--------------------------------------------


<asp:TextBox ID= " txtc_printno "  runat= " server " ></asp:TextBox>

<input name= " ctl00$MainContent$txtc_printno "  type= " text "  id= " ctl00_MainContent_txtc_printno "  /></input>

3. < system.Web > < xhtmlConformance mode= "TransitionalLegacyStrict"/ > Where Transitional is selected, Strict generates an automatic prefix ctl00, and Legacy generates an automatic prefix ctl0.


Related articles: