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

Popular posts from this blog

ios - RestKit 0.20 — CoreData: error: Failed to call designated initializer on NSManagedObject class (again) -

java - Digest auth with Spring Security using javaconfig -

laravel - PDOException in Connector.php line 55: SQLSTATE[HY000] [1045] Access denied for user 'root'@'localhost' (using password: YES) -