Hi, I want to get the value of a selected radiobutton from c# using a pagemethod but It is not working... Html and JQuery code: <script type="text/javascript" src="../javascripts/jquery-1.8.js"></script> <script type="text/javascript"> function scoreQuiz(form) { $("Save").click("live", function (e) { e.preventDefault(); if (Page_ClientValidate()) { $.checkSessionExists(function (event, data) { if (data.sessionExists) { PageMethods.Save(($('#<%=rbYesOne.ClientID%>').is(":checked"), function(){ alert("Selected"); }); else window.location.href = urlpath + "Login.aspx?returnurl=" + encodeURI("MyProduct.aspx"); } }); } } </script>
</head> <body> <form id="form1" runat="server"> <div> <asp:RadioButton ID="rbYesOne" value="1" runat="server" GroupName="Question1" /><br /> <asp:RadioButton ID="rbNoOne" value="0" runat="server" GroupName="Question1" /><br /> <asp:Button Text="Save" runat="server" /> </div> </form> </body> </html
and code behind file with c# code: [WebMethod(EnableSession = true)]// public static string Save(bool rdoYesTest) { HttpContext.Current.Session["rbYesOne"] = rdoYesTest; return HttpContext.Current.Session["rbYesOne"].ToString(); } Please can someone help fixing this and tell me what the problem is
$('[id*="rbYesOne"]').is(':checked')
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)