IIF testing value of other controls to set ENABLED

  • Thread starter Thread starter jobs
  • Start date Start date
J

jobs

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") %>' />
 
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
 
Back
Top