forum

Home / DeveloperSection / Forums / How to Disable/Enable input-box in aspx with value from SQL

How to Disable/Enable input-box in aspx with value from SQL

Anonymous User 1621 26-Jan-2015

Once again I cannot find what I want on SO, so:

I want to disable input boxes in a repeater reading values from my MS-SQL if the value is False.

Code snippet

  <tbody>
    <asp:Repeater ID="myList" runat="server" EnableViewState="true">
    <ItemTemplate>
 
        <tr>
 
            <td>
                <input type="text" disabled="<%# bool.Parse(Eval("Value1").ToString()) == true ? : "disabled" %>" />
            </td>
            <td>
                <input type="text" disabled="<%# bool.Parse(Eval("Value2").ToString()) == true ? : "disabled" %>" />
            </td>

It's the

"disabled="<%# bool.Parse(Eval("Value1").ToString()) == true ? : "disabled" %>"

I would like help with.


Updated on 27-Jan-2015
I am a content writter !

Can you answer this question?


Answer

1 Answers

Liked By