I have a two tabbed tabstrip control and am trying to handle the "OnSelect" event in my code
My View Code is as follows:(index.cshtml)
@{
ViewBag.Title =
"Home Page";
}
<
h2>@ViewBag.Message</h2>
<
p>
To learn more about ASP.NET MVC visit
<a href="http://asp.net/mvc" title="ASP.NET MVC Website">http://asp.net/mvc</a>.
</
p>
<
p>
To learn more about working with the Telerik Extensions for ASP.NET MVC, you can visit the folowing resources:
</
p>
<
ul>
<li><a href="http://demos.telerik.com/aspnet-mvc/">online demos</a></li>
<li><a href="http://www.telerik.com/help/aspnet-mvc/introduction.html">online documentation</a></li>
<li><a href="http://www.telerik.com/community/forums/aspnet-mvc.aspx">community forums</a></li>
<li><a href="http://tv.telerik.com/products/aspnet-mvc">videos on Telerik TV</a></li>
</
ul>
@(Html.Telerik().TabStrip()
.Name(
"Static List")
.SelectedIndex(1)
.Items(tabs =>
{
tabs.Add().Text(
"UI Components");
tabs.Add().Text(
"Data");
tabs.Add().Text(
"TFS Tools");
tabs.Add().Text(
"ASP.NET CMS");
})
.ClientEvents(events => events.OnSelect("onSelect"))
)
<
script type="text/javascript">
function onSelect(e) {
alert(
"in select");
}
function onLoad(e) {
alert(
"in load");
}
</script>
I have registered the scripts manually using ScriptRegistrar as follows:
@(Html.Telerik().ScriptRegistrar()
.Scripts(script => script.Add(
"/2010.3.1318/telerik.common.min.js")
.Add(
"/2010.3.1318/telerik.tabstrip.js")
.Add(
"/2010.3.1318/telerik.tabstrip.min.js")))
The home controller returns the view.
Though the tabs are displayed in the view, the OnSelect event is never raised whenever any tabs are clicked. There is no response at all whenever I click any tab. What could be wrong?