title: Disable ValidateInput for a server control
body: <p>-
  I'm using <strong>ASP.NET 3.5</strong>.
  I have a page in which i want to display a list in a formatted way:</p>
  
  <pre><code>&lt;asp:RadioButtonList runat="server" ID="Options"&gt;
      &lt;asp:ListItem Text="Yes.&lt;br /&gt;&lt;span&gt;Detailed info.&lt;/span&gt;" /&gt;
      &lt;asp:ListItem Text="No.&lt;br /&gt;&lt;span&gt;Detailed info.&lt;/span&gt;" /&gt;
  &lt;/asp:RadioButtonList&gt;
  </code></pre>
  
  <p>Now the somewhat obvious problem with this is that i <strong>can't post this control to the server</strong>, because it will detect that the code contains potentially dangerous code (the html code inside the text property of the list items). <br />
  An alternative would be not to use a server control for this list, but i need that data on the server-side code, so i would prefer to keep it as a server control.
  <br />
  From <i>my</i> point of view, i don't need to validate this specific control because none of that data will be persisted in any way, and none of that data interacts with any part of my application.<br />
  On the other hand, i do want to keep the <code>ValidateRequest</code> functionality for the rest of the page, so i can't just set</p>
  
  <pre><code>&lt;%@ Page ValidateRequest="false" ...
  </code></pre>
  
  <h3>Question:</h3>
  
  <p>Is there any way to display data in such a way without getting this error?<br /> Or is there any way in which i could disable the request validation feature only for that specific control? Something like</p>
  
  <pre><code>&lt;myLibrary:myUserControl ValidateRequest="false" ...
  </code></pre>