IIF testing value of other controls to set ENABLED

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

Eliyahu Goldin

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
 

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

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,007
Latest member
obedient dusk

Latest Threads

Top