Link to home
Start Free TrialLog in
Avatar of NickMalloy
NickMalloyFlag for United States of America

asked on

Bootstrap button not showing as selected on post back.

When my model comes back is not valid and the page reloads my radio button  that is selected does not visually show as selected. What can I do to correct this problem?

  <div id="radios">
            <div class="form-group">
                <div class="btn-group col-md-offset-1" data-toggle="buttons">
                    <label class="btn btn-default btn-lg col-md-1">
                        @Html.RadioButtonFor(model => model.SetDollarAmount, "25", new { id = "Amount25" }) $25
                    </label>
                    <label class="btn btn-default btn-lg col-md-1">
                        @Html.RadioButtonFor(model => model.SetDollarAmount, "50", new { id = "Amount50" }) $50
                    </label>
                    <label class="btn btn-default btn-lg col-md-1">
                        @Html.RadioButtonFor(model => model.SetDollarAmount, "100", new { id = "Amount100" }) $100
                    </label>
                    <label class="btn btn-default btn-lg col-md-1">
                        @Html.RadioButtonFor(model => model.SetDollarAmount, "250", new { id = "Amount250" }) $250
                    </label>
                    @Html.LabelFor(model => model.Amount, new { @class = "control-label col-md-4" })
                    <div class="col-md-2">
                        @Html.TextBoxFor(model => model.Amount, new { @class = "form-control input-large" })
                        @Html.ValidationMessageFor(model => model.Amount)
                    </div>
                </div>
            </div>
        </div>

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of kblau
kblau

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of kblau
kblau

Oh, I will do this with bootstrap next...