<%@ Control Language="c#" AutoEventWireup="false" Codebehind="WCNewClaim.ascx.cs"
<%@ Register TagPrefix="uc1" TagName="WCHeaderInfo" Src="../Controls/WCHeaderInfo.ascx" %>
<%@ Register TagPrefix="uc1" TagName="WCEmployeeOccupation" Src="../Controls/WCEmployeeOccupation.ascx" %>
<TABLE id="Table1" cellSpacing="0" cellPadding="0" border="0">
<TR>
<TD><uc1:wcheaderinfo id="WCHeaderInfo1" runat="server"></uc1:wcheaderinfo></TD>
</TR>
<TR>
<TD><uc1:wcemployeeoccupation id="WCEmployeeOccupation1" runat="server"></uc1:wcemployeeoccupation></TD>
</TR>
</TABLE>
<%@ Control Language="c#" AutoEventWireup="false" Codebehind="WCHeaderInfo.ascx.cs" Inherits=
<%@ Register TagPrefix="cc2" Namespace="RTI.WebControls.Safety.RadioButtonList" Assembly="RTIWebControlsSafety" %>
<cc2:safetywctype id="rdlCaseType" runat="server"></cc2:safetywctype>
<%@ Control Language="c#" AutoEventWireup="false" Codebehind="WCEmployeeOccupation.ascx.cs" Inherits="
<%@ Register TagPrefix="cc7" Namespace="RTI.WebControls.Driver.TextBox" Assembly="RTIWebControlsDriver" %>
<cc7:SocialSecurityTextBox id="txtSSN" runat="server"></cc7:SocialSecurityTextBox>
<script src="http://code.jquery.com/jquery.js"></script>
<script type="text/javascript">
$('#<%= WCHeaderInfo1.rdlCaseType.ClientID %>').change(function () {
var radioListID = ('<%= WCHeaderInfo1.rdlCaseType.SelectedValue %>');
alert($(radioListID));
//alert("hi");
});
</script>
<div runat="server">
<script src="http://code.jquery.com/jquery.js"></script>
<script type="text/javascript">
$('#<%= WCHeaderInfo1.rdlCaseType.ClientID %>').click(function () {
var selectedValue = $('#<%= WCHeaderInfo1.rdlCaseType.SelectedValue%>');
alert(selectedValue);
});
</script>
</div>
<div runat="server">
<script src="http://code.jquery.com/jquery.js"></script>
<script type="text/javascript">
$('#<%= WCHeaderInfo1.rdlCaseType.ClientID %>').click(function () {
var selectedValue = $('#<%= WCHeaderInfo1.rdlCaseType.ClientID %> input:radio:checked').val();
alert(selectedValue);
});
</script>
</div>
Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.
Have a better answer? Share it in a comment.
From novice to tech pro — start learning today.
1. You can use a server-side event on the custom control with the radio buttons (this resulting in a trip to the server for every radio change)
2. You can use jQuery to hide the controls after you get the value just as you did in the previous posts
3. You can use a client side javascript framework like Knockout, AngularJS, etc..
Regards,
Mishu