I’ve created a hidden field as an extension, it worked nice in Internet explorer but when I wanted it to execute in chrome or mozilla it didnot support…
public static MvcHtmlString hiddenText(this HtmlHelper helper, string Text)
{
var tag = new TagBuilder("input");
tag.MergeAttribute("id", "hid");
tag.MergeAttribute("name", Text);
tag.MergeAttribute("value", Text);
return new MvcHtmlString(tag.ToString())
}
Is there any solution so that the code i write will work in mozilla or chrome..
Thank you..
you might want to specify the input type.
On a side note, you do realise there’s already built in helpers that allow you to create hidden fields?