4

Is there a complete list of the objects you can tap into with <%$ %> tags in ASP.NET

I know you can do things like <%$ ConnectionStrings:northwind %> in the ConnectionString attribute of the <asp:SqlDataSource> tag.

Can you also do this with Cookies and Session? Is there a <%$ %> reference page out there?

Ray
  • 21,485
  • 5
  • 48
  • 64
BuddyJoe
  • 69,735
  • 114
  • 291
  • 466

1 Answers1

2

What you're looking for are called ASP.NET Expressions. AppSettings, ConnectionStrings, and Resources are the default providers made available with ASP.NET, but one can write a custom ASP.NET Expressions provider for just about anything.

The ones you're looking for (Cookies and Session) have been written and made available here.

Adam Maras
  • 26,269
  • 6
  • 65
  • 91
  • CodeExpressionBuilder is my favorite. You can see how it was built at http://weblogs.asp.net/infinitiesloop/archive/2006/08/09/The-CodeExpressionBuilder.aspx – Chris Shouts Mar 12 '10 at 16:35
  • I ended up setting the connection in the code behind based off a Session variable. Within that .zip file there seemed to be a missing base class. It was the base class that all the "Editors" inherit from. – BuddyJoe Mar 12 '10 at 19:02