This is a migrated thread and some comments may be shown as answers.
Problme with the listbox client side SelectedIndexChanged event
2 Answers 132 Views
This is a migrated thread and some comments may be shown as answers.
santhosh
Top achievements
Rank 2
santhosh asked on 29 Jul 2009, 01:56 PM
Hi,

I am using radlistbox and I want to perform some operations on listbox client side SelectedIndexChanged event and below is my code.

 

<script language="javascript" type="text/javascript">

 

 

function onSelectedIndexChanged(sender, args)

 

{

alert(

"Selected index changed");

 

}

 

</script>

 



 

<table cellpadding="2" cellspacing="2" border="0" class="TableBorder" width="100%">

 

 

<tr valign="top">

 

 

<td style="width: 105px">

 

 

&nbsp;</td>

 

 

<td class="clsLabel">

 

 

<asp:Label id="lblExisting" runat="server" text="<%$ Resources:pageLabels, lblExistingPlans %>" CssClass="clsLabel"></asp:Label>

 

 

</td>

 

 

<td style="width: 100px">&nbsp;</td>

 

 

</tr>

 

 

<tr valign="top">

 

 

<td style="width: 105px">&nbsp;</td>

 

 

<td>

 

 

<telerik:RadListBox ID="lstExistingPlans" runat="server" Width="763px" Height="250px" CssClass="clsLable" Skin="Office2007" OnClientSelectedIndexChanged="onSelectedIndexChanged()"></telerik:RadListBox>

 

 

</td>

 

 

<td style="width: 100px">&nbsp;</td>

 

 

</tr>

 

 

<tr valign="top">

 

 

<td style="width: 105px">&nbsp;</td>

 

 

<td class="clsLabel">

 

 

<asp:Label id="lblAvailable" runat="server" text="<%$ Resources:pageLabels, lblAvailablePlans %>" CssClass="clsLabel"></asp:Label>

 

 

</td>

 

 

<td style="width: 100px">&nbsp;</td>

 

 

</tr>

 

 

<tr valign="top">

 

 

<td style="width: 105px">&nbsp;</td>

 

 

<td>

 

 

<telerik:RadListBox ID="lstAvailablePlans" runat="server" Width="763px" Height="250px" CssClass="clsLable" Skin="Office2007" AutoPostBack="true"></telerik:RadListBox>

 

 

</td>

 

 

<td style="width: 100px">&nbsp;</td>

 

 

</tr>

 

 

</table>

Now the problem is this client side event fires on each postback but when I click on the listbox on which i have written the client side event its not working instead its throwing a javascript error as.

"Error: a[b] is not a function
Source File: http://localhost/Kam.Web/Telerik.Web.UI.WebResource.axd?_TSM_HiddenField_=ctl00_ContentPlaceHolder1_ScriptManager1_HiddenField&compress=1&_TSM_CombinedScripts_=%3b%3bSystem.Web.Extensions%2c+Version%3d1.0.61025.0%2c+Culture%3dneutral%2c+PublicKeyToken%3d31bf3856ad364e35%3aen-US%3a1f0f78f9-0731-4ae9-b308-56936732ccb8%3aea597d4b%3ab25378d2%3bTelerik.Web.UI%2c+Version%3d2009.2.701.20%2c+Culture%3dneutral%2c+PublicKeyToken%3d121fae78165ba3d4%3aen-US%3affafc724-e959-4dca-aca2-eeb92fdb8ca6%3a16e4e7cd%3a874f8ea2%3af7645509%3a24ee1bba%3a19620875%3a33108d14%3abd8f85e4%3ae330518b%3a1e771326%3ac8618e41%3aaa288e2d%3a58366029%3ab7778d6c%3ae085fe68%3a8674cba1%3ac08e9f8a%3aa51ee93e%3a59462f1%3a2bef5fcc%3bAjaxControlToolkit%2c+Version%3d1.0.10301.0%2c+Culture%3dneutral%2c+PublicKeyToken%3d28f01b0e84b6d53e%3aen-US%3a9b0dcc70-5e43-4d30-b6d6-3ed8d0eb217f%3ab14bb7d5%3a755018fe%3a13f47f54%3a35ff259d%3ab80820f8
Line: 6"

Kindly advise.

Regards,

Santhosh

 

2 Answers, 1 is accepted

Sort by
0
Accepted
Veselin Vasilev
Telerik team
answered on 29 Jul 2009, 02:05 PM
Hi santhosh,

Please subscribe to the client event without using the parenthesis:

OnClientSelectedIndexChanged="onSelectedIndexChanged"

Let us know if this helps.

Regards,
Veselin Vasilev
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
santhosh
Top achievements
Rank 2
answered on 29 Jul 2009, 02:20 PM
Hi Veselin Vasilev,

Yeh its working fine now.
Thank you

Regards,

Santhosh
Asked by
santhosh
Top achievements
Rank 2
Answers by
Veselin Vasilev
Telerik team
santhosh
Top achievements
Rank 2
Share this question
or