javascript - How to pass radio button list parameters into C# from HTML -
i have html code of :
<form method="post" action="feedback.aspx.cs"> <div class="container"> <h2>feedback area</h2> <br /> <h4>comfort</h4> <br /> <form role="form"> <label class="radio-inline" name="radio1"> <input type="radio" value="1" name="optradio1">bad </label> <label class="radio-inline"> <input type="radio" value="2" name="optradio2">good </label> <label class="radio-inline"> <input type="radio" value="3" name="optradio3">excellent </label> <br /> </form> </form>
and c# code :
protected void page_load(object sender, eventargs e) { if (ispostback) { string r1, r2, r3, r4; r1=string.format("{0}", request.form["radio1"]); r2=string.format("{0}", request.form["radio2"]); r3=string.format("{0}", request.form["radio3"]); r4=string.format("{0}", request.form["radio4"]); feedbackservice.insertintoreviewes(r1,r2,r3,r4); messageboxshow(page,"feedback sent."); } }
and want when hit radio button value value pass c# , function : insertintoreviews put r1,r2,r3,r4 values access dataset.
note ive attached quarter of code since long. btw closed first form tag because part of code (it closed @ end of full code).
thank much. :)
maybe you.
$('input[type=radio]').change( function() { $.ajax({ url: 'controller/insertintoreviewes', data: { radios : $("formname").serializeobject() }, success: function(result){ } }); });
Comments
Post a Comment