title: ASP.NET ObjectDataSource - reference static properties for parameter names
body: <p>I use a lot of ObjectDataSources (ods) in my website projects. Almost all of my ods's use SessionParameters; typing the session parameter name into the SessionField property of the ods is annoying and prone to typos. </p>
  
  <p>I have a static SessionParams class where I store all the session parameter names, is it possible to reference the members of that class in the ods? I've tried to do it, but it never worked.</p>
  
  <p>Here's what i have now:</p>
  
  <pre><code>&lt;asp:ObjectDataSource ID="ods" runat="server" OldValuesParameterFormatString="original_{0}"
  SelectMethod="GetStuff" TypeName="RM.Stuff"&gt;
  &lt;SelectParameters&gt;
      &lt;asp:SessionParameter  SessionField="HAVE_TO_TYPE_EVERY_TIME" Name="somename" Type="Int32" /&gt;
  &lt;/SelectParameters&gt;
  </code></pre>
  
  <p></p>
  
  <p>Here's what i want:</p>
  
  <pre><code>&lt;asp:ObjectDataSource ID="ods" runat="server" OldValuesParameterFormatString="original_{0}"
  SelectMethod="GetStuff" TypeName="RM.Stuff"&gt;
  &lt;SelectParameters&gt;
      &lt;asp:SessionParameter  SessionField='&lt;%= RM.SessionParams.SESSION_PAREMETER_NAME %&gt;' Name="somename" Type="Int32" /&gt;
  &lt;/SelectParameters&gt;
  </code></pre>
  
  <p></p>