Buho1
Member
Hi. I seem to recall being able to put arbitrary code in the ASPX, something like this:
Which would render "4" between span tags. That's a trivial example, but I would really like to automatically display a session variable:
Yes, yes, I can do this in Page_Load(); I just recall being able to do it this way, which would be a bit faster and (arguably) more logical/readable.
Thanks!
EDIT: I should mention that the above syntax renders nothing, though it seems it is being interpreted; VB.NET syntax errors in there throw exceptions.
VB.NET:
<asp:Label id="lbl" runat="server" Text='<%# 2 + 2 %>' />
Which would render "4" between span tags. That's a trivial example, but I would really like to automatically display a session variable:
VB.NET:
<asp:Label id="lbl" runat="server" Text='<%# Session("Username") %>' />
Yes, yes, I can do this in Page_Load(); I just recall being able to do it this way, which would be a bit faster and (arguably) more logical/readable.
Thanks!
EDIT: I should mention that the above syntax renders nothing, though it seems it is being interpreted; VB.NET syntax errors in there throw exceptions.