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.
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.
Here's what i have now:
<asp:ObjectDataSource ID="ods" runat="server" OldValuesParameterFormatString="original_{0}"
SelectMethod="GetStuff" TypeName="RM.Stuff">
<SelectParameters>
<asp:SessionParameter SessionField="HAVE_TO_TYPE_EVERY_TIME" Name="somename" Type="Int32" />
</SelectParameters>
Here's what i want:
<asp:ObjectDataSource ID="ods" runat="server" OldValuesParameterFormatString="original_{0}"
SelectMethod="GetStuff" TypeName="RM.Stuff">
<SelectParameters>
<asp:SessionParameter SessionField='<%= RM.SessionParams.SESSION_PAREMETER_NAME %>' Name="somename" Type="Int32" />
</SelectParameters>