Embedded code blocks in ASP.NET

Discussion in '.NET' started by Corbs, Aug 1, 2007.

  1. Corbs

    Corbs

    Joined:
    Aug 1, 2007
    Messages:
    1
    Hi,

    I was wondering if anybody could help me with a small problem of mine.

    I am loading a page in a Read-Only statement, and have the following public property declared 'public bool IsReadOnly' returning 'false' in my Page.cs.

    In the Page.aspx, I am using the property as followed in a LinkButton :

    <asp:LinkButton ID="LinkButton" BorderStyle="None" Enabled='<%# IsReadOnly%>' runat="server" />

    Problem is that this only seem to be working inside a GridView / TemplateField. Whenever I use this property outside of a GridView, it is ignored. Only the GridView's LinkButton calls it.

    Any idea why?

    Thanks,
    Corbs
     
    Corbs, Aug 1, 2007
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Arjen
    Replies:
    3
    Views:
    472
    Scott Allen
    Feb 27, 2005
  2. Guest
    Replies:
    3
    Views:
    2,833
    Bruce Barker
    Sep 6, 2005
  3. TEN TOD PSA

    TRICK: ASP.NET methods with code blocks

    TEN TOD PSA, Aug 18, 2005, in forum: ASP General
    Replies:
    1
    Views:
    136
    Bob Barrows [MVP]
    Aug 19, 2005
  4. matt
    Replies:
    1
    Views:
    297
    George Ogata
    Aug 6, 2004
  5. Steven Taylor
    Replies:
    9
    Views:
    281
    Brian Candler
    Apr 27, 2009
Loading...

Share This Page