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

Top 5 Contributors of the Month
david stephan
Gaurav Pal
Post New Web Links

Get RadioButtonList's selected value in a multiview

Posted By:      Posted Date: October 25, 2010    Points: 0   Category :ASP.Net

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?

<script src="JScripts/jquery-1.3.2.js"  type="text/javascript"></script>





<img src="Images/img.JPG"  alt=""  />


<strong>Meeting </strong><br/>

<asp:RadioButtonList ID="RadioButtonList1" runat="server"





    <asp:MultiView ID="MultiView1" runat="server">

        <asp:View ID="View1" runat="server">

            <asp:TextBox ID="Title " runat="server"></asp:TextBox></asp:View>


View Complete Post

More Related Resource Links

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; } } }    

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..

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


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" />

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


Databound dropdown list inside detailsview filtered dependent on selected radiobuttonlist item


It's driving me mad.  I have a detailsview bound to an sqldatasource. One of the items on the data table is to get its value from a dropdown list, so I created a template field and entered a dropdownlist, then bound that to a second datasource with the selection values in it. As the values can be male or female related, I have an unbound radiobuttonlist above the dropdownlist with two values - male or female - retunring an d"m" or an "f" and I want to use this to filter the records coming from the second data source for the dropdownlist.

I can't use a normal SQL control parameter on the datasource as the selector (the male/female radiobuttons) are in the detailsview and therefore "invisible".  I set up a normal control parameter with "none" as the type.  I then set the "autopostback" value to "true" for the male/female radio buttons and tried writing in the code-behind for the "maleorfemale_SelectedIndexChanged" event and using debug lines revealed that I was getting the "m" or "f" I needed by using "findcontrol", so that's fine.

I also tried adding in the "selecting" event for the second datasource to use the value of the radiobutton item, but although the "selecting" event fires

Enabling a RadioButtonList inside a multiview



Initially I set a RadioButtonList to be disabled. Only when a linkbutton

link is clicked, I wanted to enable the radiobutton list. I tried the

javascript described in the code below. Nothing works.

Any help is appreciated.

By the way, why is asp multiview doesn't show up anything in firefox.



This is what I see in viewsource

 <span disabled="disabled">
 <input id="RadioButtonList1_0" type="radio" name="RadioButtonList1" value="Y"
 disabled="disabled" onclick="javascript:setTimeout('__doPostBack(\'RadioButtonList1$0\',\'\')', 0)" />
<label for="RadioButtonList1_0">Yes</label></span></td><td><span disabled="disabled">
<input id="RadioButtonList1_1" type="radio" name="RadioButtonList1" value="N" disabled="disabled"
 onclick="javascript:setTimeout('__doPostBack(\'RadioButtonList1$1\',\'\')', 0)" />

listbox displays value from selected radiobuttonlist


This is my problem.
I have a radiobuttonlist and listbox.
In my radiobuttonlist, i put datasource, displaying date. then i put a button.
What I want to do is:
I want to make the listbox displaying studentID & subjectID when I select date from radiobuttonlist and press the button.

RadioButtonList, Gridview, TemplateColumn, get selected radio value in VB

 Imagine a retail clothes website, simple page, 1 x gridview, 1 x column (Template), 1 x table, 1 x tr, 3 x td.   td1 has image of item, td2 has title, manufacturer, price, td3 has quantity textbox and size radiobuttonlist (5 sizes small to XXL).

I have all working including getting the value from the Quantity textbox, but I can't get the selected rafiobutton value for the size.   I just want to send the size value to the shopping cart.


I enclose the various bits of code I am using, any help in getting the selected radio value would be apprecieted.


  <div style="text-align: left">
    <asp:GridView ID="gv_Action" runat="server" Width="655px" 
             AutoGenerateColumns="False" ShowHeader="False">
                   <table border="0">
                  <tr style="background-position: center center; background-image: url('Background/TR_Border.jpg')">
                     <td align="left" rowspan="3" valign="top" width="85px" >
                             <a href='View_Details.aspx?Pro

Dropdown list in ASP.NET - How to get value selected

am sure this must be very simple, but unforunately I can't figure it out.
I have the following code which populates the dropdown lists from the database. This works fine. Now, when the user selects a particular employee name from the list, I want to get the Employee Id of the selected employee. i.e. I need to get the "Eid" value. I can do this if the EId is loaded in the dropdown list, but in this case only the employee name is displayed. Please let me know howI can get the Eid value even though it is not loaded in the dropdown list.
I would really appreciate your help

Gridview that exports selected rows to Excel

his seems like a messy workaround, but I ended up using two Gridviews - one to display my data and show my checkboxes, and the other which was invisible amd would eventually end up as my Excel spreadsheet.

How to let user edit selected gridview columns, not entire row



I've got a gridview I would like to let the user edit a couple of columns.  Seems like everything I'm coming across so far makes the entire row editable.  

Hopefully the solution isn't too complicated.  Can someone point me in the right direction?


Row command working on all rows not selected one?



I have this code that hides a column in a gridview.  (The column houses another nested gridview).

    Protected Sub GridView1_RowCommand(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewCommandEventArgs) Handles GridView1.RowCommand
        If e.CommandName = "Select" Then
            If GridView1.Columns(0).Visible = False Then
                GridView1.Columns(0).Visible = True
                GridView1.Columns(0).Visible = False
            End If
        End If
    End Sub

The trouble is that if I click the select link on one row that action to hide is carried out on all rows.  How can I set this up so that it only hides the row that is selected?


Selected to change the background color of the page



As this site, http://www.borfin.com.tr/genel/Default.aspx, How can I change the background color selected pages.

Rendering data with HTML tags in the DD Gridview for a selected column


I am having trouble finding out where and how to HTML Encode a cell's data on the Dynamic Data (v4.0) gridview of List.aspx.  As a simple case, suppose I have formatted cell data that is A<br/>B in the DB.    Obviously, I want A stacked on B in the cell.

It seems gridView1.HtmlEncode = true has gone away.

So maybe I'll try to catch it on the RowDataBound event:

protected void GridView1_RowDataBound(Object sender, GridViewRowEventArgs e)

            if (e.Row.RowType == DataControlRowType.DataRow)
                // Html Encode the cells


but this event never fires?

Has anyone figured out how to properly render HTML tags data in the List.aspx's GridView1? 

If I figure this out, then I can add a MetaAttribute called something like [EncodeAsHtml(true)] and be on my way.  Thanks!

Get ServerReport selected Parameter value to use in vb query


I'm using ReportViewer in Asp.net 2.0 to view a SSRS report. I need the value of the selected parameter to use in a vb query. The parameters are populated on the server and its a single selection. Doing searches I've come across  ReportViewer1.ServerReport.GetParameters() but I can't figure out if I can use this to determine which value the user has selected in the parameter dropdownlist. Any help would be appreciated.

Modify Menu adapter to show selected


Hey, I need some help modifying the menu adapter code to give child <ul> elements a class value indicating that the parent is selected. It should render like this:


< ul class="AspNet-Menu">
	< li class="AspNet-Menu-WithChildren  AspNet-Menu-ChildSelected">
		< a href="/rockit/admin/Default.aspx" class="AspNet-Menu-Link  AspNet-Menu-ChildSelected">
		< span>Mypage< /span>< /a>
			< ul class="AspNet-Sub AspNet-Sub-Selected">
				< li class="AspNet-Menu-Leaf  AspNet-Menu-Selected">
					< a href="/rockit/admin/Default2.aspx" class="AspNet-Menu-Link  AspNet-Menu-Selected">
					< span>Test< /span>< /a>
				< /li>
				< li class="AspNet-Menu-Leaf">
					< a href="/rockit/Default3.aspx" class="AspN

How to keep the hover for Parent menu and set the selected menu item css for child menu item?



I'm using cssfriendly control adapter for menu. My asp.net menu control's datasource is a sitemap file I'm using which contains all the urls.

I have the following questions:

  1. Is there a way to keep the parent menu item hovered while hovering over the respective child menu items?
  2. Is there a way to keep the child menu item selected? I am able to set the css for the parent menu, however I was wondering if the same is possible with the child items.

Please help! Smile


Moneka Smile

.AspNet-Menu-Selected Problems


I am trying to have the selected item in the menu be noticeable different than the other items.  I am able to change the border as in the samples, but nothing else. I would like the selected font color to change as well as the background image / color.  Here is a sample page and style sheet.  Any help is greatly appreciated.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>Untitled Page</title>
    <link href="MainStyle.css" rel="stylesheet" type="text/css" />
    <form id="form1" runat="server">
    <table border="0" cellpadding="0" cellspacing="0" style="width: 100%; height: 100%">
                    <!-- Indention Pushes First Link Over -->

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