473,395 Members | 2,006 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Get RadioButtonList's selected value in a multiview

Hi,
I use jquery in a page that shouldn't refresh when radiobuttonlist items are selected.(without using AJAX)
how can i call selectedindexchanged event for accessing items using by javascript?
Expand|Select|Wrap|Line Numbers
  1. <script src="JScripts/jquery-1.3.2.js"  type="text/javascript"></script>
  2.  
  3. <ul> 
  4. <li> 
  5. <a> 
  6. <img src="Images/img.JPG"  alt=""  /> 
  7. <p>
  8. <strong>Meeting </strong><br/>
  9. <asp:RadioButtonList ID="RadioButtonList1" runat="server" OnSelectedIndexChanged="RadioButtonList1_SelectedIndexChanged" AutoPostBack="true">
  10.         <asp:ListItem>Title</asp:ListItem>
  11.         <asp:ListItem>Date</asp:ListItem>
  12.         <asp:ListItem>Time</asp:ListItem>
  13.     </asp:RadioButtonList>
  14. <asp:MultiView ID="MultiView1" runat="server">
  15.         <asp:View ID="View1" runat="server">
  16.             <asp:TextBox ID="Title " runat="server"></asp:TextBox></asp:View>
  17.  
  18.         <asp:View ID="View2" runat="server">
  19.             <asp:TextBox ID="Date" runat="server"></asp:TextBox</asp:View>
  20.  
  21.         <asp:View ID="View3" runat="server">
  22.             <asp:TextBox ID="Time" runat="server" MaxLength="2" Width="15px">00</asp:TextBox>
  23.             </asp:View>
  24.     </asp:MultiView><br />
  25. </p> 
  26. </a> 
  27. </li>
  28. </ul>
Expand|Select|Wrap|Line Numbers
  1. protected void RadioButtonList1_SelectedIndexChanged(object sender, EventArgs e)
  2.     {
  3.         if (RadioButtonList1.SelectedItem.Text == "Title")
  4.             MultiView1.ActiveViewIndex = 0;
  5.         else if (RadioButtonList1.SelectedItem.Text == "Date")
  6.             MultiView1.ActiveViewIndex = 1;
  7.         else if (RadioButtonList1.SelectedItem.Text == "Time")
  8.             MultiView1.ActiveViewIndex = 2;
  9.     }
  10.  
Oct 25 '10 #1
1 3778
Frinavale
9,735 Expert Mod 8TB
You must access the server-side C# code by making a request to the page.

Since you want to have this page request done asyncronously you have to use Ajax.

The easiest way to do this is to place the radio button list in an ASP.NET UpdatePanel.

Or, if you really want to use JQuery, you could set the RadioButton AutoPostaback to False, and then implement a JavaScript method that is called when the selected index changed...in this case you could use JQuery to submit the page to the server. This seems a bit silly though.

-Frinny
Oct 25 '10 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: juststarter | last post by:
Hello, I have an aspx file where i've put a placeholder element. On load i create dynamically a table which contains a checkbox and a radiobuttonlist in each tablerow . The radiobuttonlist...
3
by: William LaMartin | last post by:
If I create a RadioButtonList with, say, two items, then after the page loads and I select one of the items and then click on a button whose click event contains some code to display the...
2
by: mg | last post by:
After a selection is made in the following RadioButtonList <asp:RadioButtonList id="RadioButtonList1" runat="server"> <asp:ListItem Value="Y"></asp:ListItem> <asp:ListItem...
0
by: Jay | last post by:
I have a radiobuttonlist like so <asp:RadioButtonList id=radType RepeatDirection="Horizontal" cellpadding="10" cellspacing="0" runat="server"><asp:ListItem value="Something1"><font...
4
by: juststarter | last post by:
Hello, I have an aspx file where i've put a placeholder element. On load (page_load) i create dynamically an html table which contains a checkbox and a radiobuttonlist in each tablerow . The...
5
by: Øyvind Isaksen | last post by:
I'm making a page to update articles. When a radiobuttonlist is displayed, I want the stored value to be displayed as default (checked). Example: I use a procedure to display the...
6
by: SAL | last post by:
hello, I'm using a radiobuttonlist in an updatepanel in an item template in a Gridview control. I'm populating the radiobuttonlist in the RowDataBound event. I have the control toolkit registered...
1
by: shahanaj | last post by:
I've a radioButtion list, Which selected value always remain 0,How can I get actual value. The feagure of RadioButtonList is <asp:RadioButtonList ID="AcademicSemesterRadioButtonList"...
1
by: prashk | last post by:
My page is using the Master page . I am using TabContainer ajax control in my aspx page and have a TabPanel that contains a RadioButtonList control and a text box. I want to show/hide populate...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.