0

attempting to set a radio button on a grid view via a condition.

 <input name="MyRadioButton" id="MyRadioButton<%=RadioNum() %>" type="radio" value='<%# Eval("TCMD_DCMNT_NBR") & Eval("VNDR_RQST_NBR") %>' style="left:auto" <% Eval("IsPostBack") {checked="checked"} {} %> /> 
                    <label for="MyRadioButton<%=RadioNumLabel() %>" style="display:none;"><%# Eval("TCMD_DCMNT_NBR") & Eval("VNDR_RQST_NBR") %></label>
                </ItemTemplate>

not quite sure how to set the checked to true when my IsPostBack is true.

thanks

Bryan Dellinger
  • 4,724
  • 7
  • 33
  • 79

1 Answers1

0

If I remember correctly, you should be able to reference the Page.IsPostBack property directly to set your attribute using a simple ternary operator :

<%= Page.IsPostBack ? "checked='checked'" : "" %>
Rion Williams
  • 74,820
  • 37
  • 200
  • 327