0

i have a very simple HTML extension :

    public static MvcHtmlString test(this HtmlHelper helper, IHtmlString item)
    {
        var inputTag = new TagBuilder("div");
        inputTag.MergeAttribute("class", "dropdown-with-tab-content white-background secondary-tab-tab-content white-background active");
        inputTag.MergeAttribute("id", "aga");
        inputTag.InnerHtml = MvcHtmlString.Create(item.ToString()).ToString();

        return MvcHtmlString.Create(inputTag.ToString());
    }

my call from view :

@Html.test(Html.Partial("Partials/_State", Model)) 

partial view :

<div class="col-md-12 IssuanceDate RedeemedDate">


        <div class="form-group" style="margin-left: 20px; ">
            <label>test</label>
            <br />
            <input type="radio" name="radAnswer" /> Female
            <input type="radio" name="radAnswer" /> Female
            <input type="radio" name="radAnswer" /> Female
            <input type="radio" name="radAnswer"/> Female

        </div>

</div>

if i use html extension like this, all radio button will not be able to be checked.

however if in my HTML extension i return MvcHtmlString.Create(item.ToString()) directly, everything is fine. Does anyone have a solution for this?

PS. No classes on the div does anything to make buttons unclickable, or anything else, i can see that radio button is clicked, but it never gets checked.

Timsen
  • 4,066
  • 10
  • 59
  • 117
  • 1
    You code works perfectly (I can select any of the radio buttons), so you issue is not related to the code you have shown –  Sep 03 '15 at 00:26
  • You are right, for some reason dropdown-with-tab-content which contains just padding: 15px !important; gives this result – Timsen Sep 03 '15 at 06:16

0 Answers0