I have a radMenu with an ItemTemplate in it. Within that ItemTemplate, I have an asp textbox and imagebutton comprising a search feature. How can I get a server side event to fire when that imagebutton is clicked? I can't seem to access it. I understand how to access and change properties of controls within ItemTemplate. But I cannot figure out how to get an event handler. Here is my code. Thanks for your help!
This code behind obviously does not work as "btnSearch" is not recognized in the handler.
<telerik:RadMenu ID="trmNavSearch" runat="server" Skin="NavSearch" EnableEmbeddedSkins="false" |
EnableEmbeddedBaseStylesheet="false"> |
<Items> |
<telerik:RadMenuItem runat="server" Width="164px"> |
<ItemTemplate> |
<asp:TextBox ID="tbSearch" ValidationGroup="vgSearch" MaxLength="100" |
runat="server" CssClass="textbox"></asp:TextBox> |
<asp:ImageButton ValidationGroup="vgSearch" ID="btnSearch" runat="server" |
ImageUrl="~/global/images/green_arrow_submit.png" /> |
</ItemTemplate> |
</telerik:RadMenuItem> |
</Items> |
</telerik:RadMenu> |
This code behind obviously does not work as "btnSearch" is not recognized in the handler.
Protected Sub btnSearch_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnSearch.Click |
Dim myURL As String = "" |
myURL = myURL & "Search.aspx?SearchTerm=" & trmNavSearch.FindItemByText("tbSearch").Text.Trim & "&I=" |
Response.Redirect(myURL.ToString) |
End Sub |