.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
MarieAdela
Imran Ghani
Post New Web Links

Get asp.net radiobuttonlist selected value in code behind when using jQuery buttonset

Posted By:      Posted Date: September 20, 2010    Points: 0   Category :ASP.Net
 

I am using the jQueryUI buttonset on an ASP.NET radiobuttonlist. I need to get the selected value in server-side code when the page posts back. If I don't apply the jQuery buttonset, this is of course easy enough - just grab "SelectedValue". However, when I do apply jQuery buttonset, the selected value does not appear to be available on postback any longer. Is there any way around this, or do I need to get the selected value on clientside, and then pass it back myself?

<asp:RadioButtonList ID="RadioButtonList0" CssClass="ratingButtons" runat="server">
    <asp:ListItem Text="Option1" Value="1"/>
    <asp:ListItem Text="Option2" Value="2" />
    <asp:ListItem Text="Option" Value="3" />
    <asp:ListItem Text="Option4" Value="4" />
</asp:RadioButtonList>

  $(function () {
      $(".ratingButtons").buttonset();
      $(".ratingButtons").click(function () { return false; });
  });


 




View Complete Post


More Related Resource Links

call JavaScript - jQuery code from ASP.NET Server-Side

  
jQuery got so close to me lately that I can see myself adding the scripts to my project almost unconsciously. The thing is, jQuery is very useful for me, in almost all situations and it has been a do or die enhancement for all my project since I first put my hands on it.

Of course while using it, you encounter few situations which need a bit of research to solve, mostly when you are trying to combine it with some other technologies like: UpdatePanels and ASP.NET Ajax. For instance there are many situations when I would like to run some jQuery magic based on some decision that I make on the server side.

call JavaScript - jQuery code from ASP.NET Server-Side

  
jQuery got so close to me lately that I can see myself adding the scripts to my project almost unconsciously. The thing is, jQuery is very useful for me, in almost all situations and it has been a do or die enhancement for all my project since I first put my hands on it.

Of course while using it, you encounter few situations which need a bit of research to solve, mostly when you are trying to combine it with some other technologies like: UpdatePanels and ASP.NET Ajax. For instance there are many situations when I would like to run some jQuery magic based on some decision that I make on the server side

jquery autocomplete selected value

  

Hi,

Iam using jquery autocomplete to search data and i have button to get the detail value of employee and

display in label , what i need is that , i don't want to put button to get detail , instead i need to select the from\

auto search and press enter key  and show the detail in the lablel example(empname,address, emailid).


Looking forward valuable suggestions


Use DB query result to generate Jquery required lines of code

  

Hello

I 'm gonna query database for photo records. each record include "photo path" where imagesURL  stored in string format

 I Choses my favorite Juqery plugin to show images. Plugin needs some lines of code like below.

How could I  generate these lines

<script>
$(function() {
$('#slideshow').crossSlide({
sleep: 2,
fade: 1
}, [
{ src: 'picture1.jpg' },
{ src: 'picture2.jpg' },
......
.....
{ src: 'picture4.jpg' }
])
});
</script>

how to get the text of selected checkbox from asp.net checkboxlist control using jquery

  

I have asp.net checkboxlist control that bounded to a data source so the number of items in the control are different from one to to another time.

I have this function:

     $('#<%=chkListGroups.ClientID %> input:checkbox:checked').siblings('label').text();

this function will return all texts for all selected items in the control as a one string.


 I'm looking for a way that when I check a check box from the ckeckboxlist control will return only last checked checkbox.


this code :

$('#<%=chkListGroups.ClientID %> input:checkbox:checked').last().siblings('label').text(); 

returns last checked item for example if I checked second will return
second item then when I checked fifth item will return fifth item but
if now when I check third item will return fifth item so it is always
returning last item checked in the list and I'm looking to


Please advice me how to do this using jquery.




Javascript code to copy selected dropdown item to clipboard

  
Does anyone know how I can do this to get the text onto the clipboard?  <input id="Copy" type="button" value="Copy Url" runat="server" onclick="copy();" style="vertical-align: top;" visible="false"/><script type="text/javascript"> function copy() { var sel = document.getElementById("DropDownList1"); var text = sel.options[sel.selectedIndex].value; ??? } </script> </body>  

jQuery radiobuttonlist

  
Hi,I'm trying to show/hide a div based on the selected value of radiobuttonlist using jQuery (1.3.2.min). I've tried a thousand different methods and can't get any of them to work :( I have the following code so far:<asp:RadioButtonList ID="rdbMeds" CssClass="assess" RepeatLayout="Flow" RepeatDirection="Horizontal" runat="server"> <asp:ListItem value="yes">Yes</asp:ListItem> <asp:ListItem value="no" Selected="true">No</asp:ListItem> </asp:RadioButtonList> <div id="rdbMeds_hid"> If yes, please specify what it is for: <asp:TextBox ID="tbMeds" CssClass="textboxnormal" runat="server" /> </div> And I have the following jQuery:$(document).ready(function(){$("#rdbMeds").change(function(){//If checkedif ($("#rdbMeds").attr(":checked")){//show the hidden div$("#rdbMeds_hid").show("fast");} else { //otherwise, hide it $("#rdbMeds_hid").hide("fast");}});});Any help would be much appreciated.

Binding RadioButtonList from Code Behind

  
I'm trying to populate my form that is made up of RadioButtonLists, a Text Box and a DropDown via Code Behind.  WHen I run it, the Text Box and the DropDown populate, but the RadioButtonLists do not.  I'm guessing it has to do with the SelectedValue command, but I'm not sure what to use.  Here is my aspx page:<ContentTemplate> <div style="height:402px;"> <br /> <table> <tr> <td colspan="2"> <p style="font-size:90%;">Here, you can set your preferences for notifications during the draft. You can change them at any time.</p> <p style="font-size:90%;">You will always be emailed if it is your turn to pick and you have no players in the Pick Queue.</p> </td> </tr> <th colspan="2"> Email Options </th> <tr> <td> Send

Ajax/Jquery code on UserControls

  
Hello,I have some user controls where I would like to add some javascript that uses Ajax and Jquery technology. Also these scripts should use Sys.WebForms.PageRequestManager.getInstance().add_endRequestand other functions of the Ajax framework.In the past I have added the related code to the hosting aspx page but it becomes a problem when re-using the same control in multiple aspx.Which are the best practice to follow in this case?Regards

Getting Selected Item in radiobuttonlist on content page using javascript

  
I am trying get the selected value from a radiobuttonlist on a content page using javascript. Here is my initial code, which does not recognize the control. The js is located in a separate file and there is a link on the content page pointing to the js file. Thanks, function GetRadioButtonValue() { var radio = document.getElementsByName('<%=rblPayType.ClientID%>'); for (var j = 0; j < radio.length; j++) { if (radio[4].checked) { alert(); return; } else { return; } } }    

Get selected row value based on checkbox selected in gridview using jquery

  
Hi ,    i am having gridview with two columns.one column contains checkboxes and another column contains Name.i have given UserId to DataKeyNames in gridview.Now i will check some checkboxes in gridview and click on button GetData. whenver i click on button GetData i need to get datakey values of all the gridview rows whatever checked in gridview using JQUERYPlease help me i am new to JQUery

JQuery Plugin: calling jConfirm from asp.net (code behind)

  
i am using jquery plugin and i got stuck in how to display the confirmation window from code behind and if the user choose "ok" than go ahead delete otherwise ignore. jConfirm('Can you confirm this?', 'Confirmation Dialog', function(r) { jAlert('Confirmed: ' + r, 'Confirmation Results'); }); anybody have done similar?  

Selected value of RadioButtonList inside a formview get cleared on button click.

  
Hi all,I placed a RadioButtonList inside a Formview control.And from  DataBound event handler of formview ,RadioButtonList is binded to the datasource .Now my problem is after selecting a value from radiobuttonlist and I click any button,the radiobuttonList get unchecked and lose the selected value .How can I avoid this.Please help..

jQuery instead of UpdatePanel (repeater loads when item in dropdown is selected)

  
Hello!I want to develop web page on which most of the things happens on clientside. The page contains several tabs (jQuery). One tabbed section have repeater which load when item in dropdown is selected.I've placed this 2 controls in UpdatePanel. Does somebody have any example how to achieve this without UpdatePanel, with jQuery?  I've heard that UpdatePanels are bad for page performance. I'm very new to jQ and Ajax.Thanks!all the bestBlaz

get the ddl selected value using jquery

  

salam to all,

i tried manytimes to get the selected value for a dropdownlist using jquery, but i failed!!

when i put the following code to get the text i get it successfully,


        var ResultValue = $('#<%= ResultDropDownList.ClientID %> :selected').text();



but when i try :


        var ResultValue = $('#<%= ResultDropDownList.ClientID %> :selected').value;

i am not !!!

what is the problem here?


JQuery: is there a way to show status message - from code behind?

  

i am trying to figure out how to display message box after it done executing the server side code

 here is the code which works from the client side but still looking for a way to make it work from code-behind

.aspx

<div id="status"></div>

script:

$("#status").fadeTo(500, 1, function() { $(this).html("You are now registered!").fadeTo(7000, 0); })


set selected value after jQuery populated Dropdownlist

  

Hello,


i'm using jQuery to populate an cascading dropdownlist. But i want to set a selected item after jQuery filled the DDL with items.

How do i do that?


Greetings


Categories: 
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend