title: Make textbox in UserControl become readonly
body: <p>I have a couple of textbox in the UserControl. How am I going to change them into readOnly = true/false depending on the conditions?</p>
  
  <p>In my content page, I have the following codes:</p>
  
  <pre><code>&lt;%@ Register TagPrefix="uc1" TagName="item" Src="~/User_Controls/itemDetails.ascx" %&gt;
  &lt;asp:Content ID="Content2" ContentPlaceHolderID="MainContent_1" runat="server"&gt;
  &lt;uc1:item id="ItemList" runat="server"&gt;&lt;/uc1:item&gt;&lt;br /&gt;
  &lt;/asp:Content&gt;
  </code></pre>
  
  <p>Code behind:</p>
  
  <pre><code>protected void Page_Load(object sender, EventArgs e)
  {
          if (//Some Conditions)
          {
              //turn ItemList.txtItemName = enable read Only
          }
  
          if (//Some other Conditions)
          {
              //turn ItemList.txtItemPrice = disable read Only
          }
  }
  </code></pre>
  
  <p>In the ItemDetails.ascx.cs:</p>
  
  <pre><code>    protected void Page_Load(object sender, EventArgs e)
      {
      }        
  
      public string itemName
      {
          get { return txtItemName.Text; }
          set { txtItemName.Text = value; }
      }
  
      public string itemPrice
      {
          get { return txtItemPrice.Text; }
          set { txtItemPrice.Text = value; }
      }
  
      //and get...set... for other controls
  </code></pre>