How to pass Javascript Value to a method in C# -


here radio button list

<asp:radiobuttonlist id="geo_radio" runat="server" repeatdirection="vertical" repeatlayout="table" >                                  <asp:listitem value="state">state</asp:listitem>     <asp:listitem value="county">county</asp:listitem>     <asp:listitem value="county subdivision">county subdivision</asp:listitem>     <asp:listitem value="place">place</asp:listitem>     <asp:listitem value="micropolitan">micropolitan</asp:listitem>     <asp:listitem value="combined statistical area">combined statistical area</asp:listitem>     <asp:listitem value="congressional districts">congressional districts</asp:listitem>     <asp:listitem value="custom region">custom region</asp:listitem> </asp:radiobuttonlist>   

i able retrieve selected value using

$('#<%=geo_radio.clientid%>').find('input[type="radio"]').click(function () {     var selectedvalue = $(this).val(); }); 

in .aspx page have method fetchdata(). calling function on page load

protected void page_load(object sender, eventargs e) {     fetchdata();    }  

how can send selected radio button value fetchdata() function.

you can use hidden field, set value of asp hidden field, or can use request object retrieve value.

the hidden field class


Comments

Popular posts from this blog

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

html - How to style widget with post count different than without post count -

url rewriting - How to redirect a http POST with urlrewritefilter -