Inline HTML calls

  • Thread starter Thread starter maloney1
  • Start date Start date
M

maloney1

I am wondering if there is a way outside of a databound control(ie
GridView, Datalist, etc) to call .Net methods. for instance in the
following example I want make a LinkButton invisible by checking if
the User is authenticated:

<asp:LinkButton
ID="LinkButton1" runat="server"
CssClass="right" PostBackUrl="~/AdminPages/
Management.aspx"
Style="position: static"
Visible='<%#
HttpContext.Current.User.Identity.IsAuthenticated %>'
Management Pages</asp:LinkButton>

I am pretty sure you can do this with any ASP.Net Control, but it
doesn't seem to be working.

Thanks
John
 
maloney1 said:
I am wondering if there is a way outside of a databound control(ie
GridView, Datalist, etc) to call .Net methods. for instance in the
following example I want make a LinkButton invisible by checking if
the User is authenticated:

<asp:LinkButton
ID="LinkButton1" runat="server"
CssClass="right" PostBackUrl="~/AdminPages/
Management.aspx"
Style="position: static"
Visible='<%#
HttpContext.Current.User.Identity.IsAuthenticated %>'

I am pretty sure you can do this with any ASP.Net Control, but it
doesn't seem to be working.

Try it out with <%= instead of <%#. The first one evaluates the
expression, while the second one is used for databinding.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top