IIF testing value of other controls to set ENABLED

Discussion in 'ASP .Net' started by jobs, Jul 24, 2007.

  1. jobs

    jobs Guest

    If done something like this before:
    <asp:Button ID="Run" SkinID="Button" Text="Run" CommandArgument='<
    %#Eval("Jobname") %>' CommandName="Run" Enabled='<%#
    IIF(Container.DataItem("isrunning")= "TRUE", "FALSE" , "TRUE") %>'
    runat="server" />
    </ItemTemplate>
    </asp:TemplateField>



    Can I do something like this? to test the value of another control?
    It's not working. Also, any way to something like a case?


    <asp:TextBox ID="DateOfBirthTextBox"
    enabled='<%# IIF(RESPONSE.WRITE(CashButton.selectedvalue) = "Cash" ,
    "FALSE") %>'
    runat="server" SkinID="Retailer" Text='<%# Bind("DateOfBirth") %>' />
    jobs, Jul 24, 2007
    #1
    1. Advertising

  2. Welcome to Asp.Net!

    The most flexible way of databinding is handling RowDataBound event. The
    event fires for every row as it gets databound. You can access every the
    fields of the DataItem and the columns and controls on the row as you wish
    for checking and setting their properties.

    --
    Eliyahu Goldin,
    Software Developer
    Microsoft MVP [ASP.NET]
    http://msmvps.com/blogs/egoldin
    http://usableasp.net


    "jobs" <> wrote in message
    news:...
    > If done something like this before:
    > <asp:Button ID="Run" SkinID="Button" Text="Run" CommandArgument='<
    > %#Eval("Jobname") %>' CommandName="Run" Enabled='<%#
    > IIF(Container.DataItem("isrunning")= "TRUE", "FALSE" , "TRUE") %>'
    > runat="server" />
    > </ItemTemplate>
    > </asp:TemplateField>
    >
    >
    >
    > Can I do something like this? to test the value of another control?
    > It's not working. Also, any way to something like a case?
    >
    >
    > <asp:TextBox ID="DateOfBirthTextBox"
    > enabled='<%# IIF(RESPONSE.WRITE(CashButton.selectedvalue) = "Cash" ,
    > "FALSE") %>'
    > runat="server" SkinID="Retailer" Text='<%# Bind("DateOfBirth") %>' />
    >
    Eliyahu Goldin, Jul 25, 2007
    #2
    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. Gabor
    Replies:
    3
    Views:
    602
    Jacob Yang [MSFT]
    Aug 26, 2003
  2. Max
    Replies:
    2
    Views:
    4,620
  3. Vishal

    IIF problem

    Vishal, Nov 29, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    384
    Vishal
    Nov 29, 2004
  4. =?Utf-8?B?cm9kY2hhcg==?=

    iif not working

    =?Utf-8?B?cm9kY2hhcg==?=, Jun 3, 2005, in forum: ASP .Net
    Replies:
    4
    Views:
    1,828
    =?Utf-8?B?cm9kY2hhcg==?=
    Jun 3, 2005
  5. Sparky Arbuckle

    IIF Function

    Sparky Arbuckle, Sep 6, 2005, in forum: ASP .Net
    Replies:
    5
    Views:
    2,786
    Chris Botha
    Sep 7, 2005
Loading...

Share This Page