c# - how to Radio button into hyperlink (Asp.net mvc) -
according culture language change. i'm using radio button,it works fine using razor syntax. here code snippet:-
{ var culture = system.threading.thread.currentthread.currentuiculture.name.tolowerinvariant(); } @helper selected(string c, string culture) { if (c == culture) { @:click="click" } } @using (html.beginform("setculture", "home")) { <fieldset> <div class="control-group"> <div class="controls"> <label for="en-us"> <input name="culture" id="en-us" value="en-us" type="radio" @selected("en-us", culture) /> english | <input name="culture" id="ar" value="ar" type="radio" @selected("ar", culture) /> arabic </label> </div> </div> }
jquery section
@section scripts { @scripts.render("~/bundles/jqueryval") <script type="text/javascript"> (function ($) { $("input[type = 'radio']").click(function () { $(this).parents("form").submit(); // post form }); })(jquery); </script> }
but require hyperlink it's use radio button replace
Comments
Post a Comment