Solved

what is wrong with this syntax ?

Posted on 2009-06-29
2
382 Views
Last Modified: 2012-05-07
I am getting a javascript error when I put this syntax on aspx page - what is wrong with this  OnClientSelectedIndexChanged='<%# "ShowPercentage(\"" + Container.FindControl("rcbActivityCodes").ClientID + "\",  \"" + Container.FindControl("rntPercentage").ClientID + "\")" %>' ?  
                 
<telerik:RadComboBox ID="rcbActivityCodes"  EnableAjaxSkinRendering="true" runat="server"
                       OnClientSelectedIndexChanged='<%# "ShowPercentage(\"" + Container.FindControl("rcbActivityCodes").ClientID + "\",  \"" + Container.FindControl("rntPercentage").ClientID + "\")" %>' >

Open in new window

0
Comment
Question by:tech_question
2 Comments
 
LVL 39

Expert Comment

by:abel
ID: 24740278
That depends on what that renders to when your page is loaded and/or whether ShowPercentage does not exist and/or what error you get. Can you update with answers to these three questions?
0
 
LVL 12

Accepted Solution

by:
wht1986 earned 500 total points
ID: 24740322
On the telerik controls, you can specify that function.  OnClientSelectedIndexChanged has a specific signature it looks for.  Please see the documentation here
http://www.telerik.com/help/aspnet-ajax/combo_clientsideonclientselectedindexchanged.html

basically all you can do is specify the name of the jabascript method
<telerik:RadComboBox  ID="RadComboBox1"  runat="server" OnClientSelectedIndexChanged="OnClientSelectedIndexChanged" />

The parameter values are set by telerik code
function OnClientSelectedIndexChanged(sender, eventArgs)
{
 var item = eventArgs.get_item();
 sender.set_text("You selected " + item.get_text());
}
0

Featured Post

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question