| ====> Default.aspx |
| |
| |
| <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="Context._Default" %> |
| |
| <%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %> |
| <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
| <html xmlns="http://www.w3.org/1999/xhtml"> |
| <head id="Head1" runat="server"> |
| <title></title> |
| <style type="text/css"> |
| .rtbFocused |
| { |
| background: red !important; |
| } |
| </style> |
| <link href="./styles/style.css" rel="stylesheet" type="text/css" /> |
| </head> |
| |
| <body> |
| <form id="form1" runat="server"> |
| <telerik:RadScriptManager ID="ScriptManager" runat="server"> |
| </telerik:RadScriptManager> |
| |
| <script type="text/javascript"> |
| |
| function showMenu(e) { |
| var contextMenu = $find("<%= rcmSearchMenu.ClientID %>"); |
| |
| if ((!e.relatedTarget) || (!$telerik.isDescendantOrSelf(contextMenu.get_element(), e.relatedTarget))) { |
| contextMenu.show(e); |
| } |
| |
| $telerik.cancelRawEvent(e); |
| } |
| |
| function hideMenu(e) { |
| var contextMenu = $find("<%= rcmSearchMenu.ClientID %>"); |
| |
| var mItem = contextMenu.findItemByText("Advanced"); |
| |
| var ctrol = mItem.findControl("tbAdvSearch"); |
| //alert(mItem) |
| |
| if ((!e.relatedTarget) || (!$telerik.isDescendantOrSelf(contextMenu.get_element(), e.relatedTarget))) { |
| contextMenu.hide(e); |
| } |
| |
| $telerik.cancelRawEvent(e); |
| } |
| |
| </script> |
| |
| <asp:ImageButton ID="ibAdvanced" runat="server" ImageUrl="~/images/View.gif" |
| OnClientClick="showMenu(event)" ImageAlign="AbsMiddle" ToolTip="Advanced Search" /> |
| |
| <telerik:RadContextMenu runat="server" ID="rcmSearchMenu" Skin="Vista" CssClass="advSearch-m"> |
| <Items> |
| <telerik:RadMenuItem Text="Advanced" CssClass="advSearch" PostBack="false"> |
| <ItemTemplate> |
| <asp:ListBox ID="lbField" Rows="1" Width="100px" SelectionMode="Single" runat="server"> |
| <asp:ListItem> A </asp:ListItem> |
| <asp:ListItem> B </asp:ListItem> |
| <asp:ListItem> C </asp:ListItem> |
| </asp:ListBox> |
| <asp:ListBox ID="lbOperator" Rows="1" Width="100px" SelectionMode="Single" runat="server"> |
| <asp:ListItem> Greater </asp:ListItem> |
| <asp:ListItem> Less </asp:ListItem> |
| </asp:ListBox> |
| <asp:RequiredFieldValidator ID="rfvAdvSearch" runat="server" ControlToValidate="tbAdvSearch" |
| ValidationGroup="vgAdvSearch" Text="empty*" /> |
| <asp:TextBox ID="tbAdvSearch" runat="server" EnableViewState="true" /> |
| <asp:LinkButton ID="lkbAdvSearch" runat="server" Text="Advanced Searc" CssClass="advSearch-button" |
| ValidationGroup="vgAdvSearch" ToolTip="Click to Search" |
| EnableViewState="true" onclick="lkbAdvSearch_Click" /> |
| <asp:ImageButton ID="ibCancel" runat="server" ImageUrl="~/images/Cancel.gif" |
| ImageAlign="AbsMiddle" OnClientClick="hideMenu(event)" ToolTip="Cancel" /> |
| </ItemTemplate> |
| </telerik:RadMenuItem> |
| </Items> |
| </telerik:RadContextMenu> |
| |
| </form> |
| </body> |
| </html> |
| |
| |
| |
| |
| ==> Default.aspx.cs |
| |
| using System; |
| using System.Collections.Generic; |
| using System.Linq; |
| using System.Web; |
| using System.Web.UI; |
| using System.Web.UI.WebControls; |
| using System.Data; |
| using Telerik.Web.UI; |
| |
| |
| namespace Context |
| { |
| public partial class _Default : System.Web.UI.Page |
| { |
| protected void Page_Load(object sender, EventArgs e) |
| { |
| |
| |
| } |
| |
| |
| protected void lkbAdvSearch_Click(object sender, EventArgs e) |
| { |
| TextBox AdvSearchTextBox = (TextBox)((LinkButton)sender).NamingContainer.FindControl("tbAdvSearch"); |
| ListBox fieldListBox = (ListBox)((LinkButton)sender).NamingContainer.FindControl("lbField"); |
| ListBox operatorListBox = (ListBox)((LinkButton)sender).NamingContainer.FindControl("lbOperator"); |
| |
| Response.Write("Text in TextBox-"+AdvSearchTextBox.Text); |
| // No comiplation, no runtime error |
| // But I am not getting the Text value I enter in Textbox, Also, I am not getting value of ListBox Item I selected either |
| |
| } |
| } |
| } |
| |
| |
| |
| ==> Default.aspx.designer.cs |
| |
| //------------------------------------------------------------------------------ |
| // <auto-generated> |
| // This code was generated by a tool. |
| // Runtime Version:2.0.50727.3603 |
| // |
| // Changes to this file may cause incorrect behavior and will be lost if |
| // the code is regenerated. |
| // </auto-generated> |
| //------------------------------------------------------------------------------ |
| |
| namespace Context { |
| |
| |
| public partial class _Default { |
| |
| /// <summary> |
| /// Head1 control. |
| /// </summary> |
| /// <remarks> |
| /// Auto-generated field. |
| /// To modify move field declaration from designer file to code-behind file. |
| /// </remarks> |
| protected global::System.Web.UI.HtmlControls.HtmlHead Head1; |
| |
| /// <summary> |
| /// form1 control. |
| /// </summary> |
| /// <remarks> |
| /// Auto-generated field. |
| /// To modify move field declaration from designer file to code-behind file. |
| /// </remarks> |
| protected global::System.Web.UI.HtmlControls.HtmlForm form1; |
| |
| /// <summary> |
| /// ScriptManager control. |
| /// </summary> |
| /// <remarks> |
| /// Auto-generated field. |
| /// To modify move field declaration from designer file to code-behind file. |
| /// </remarks> |
| protected global::Telerik.Web.UI.RadScriptManager ScriptManager; |
| |
| /// <summary> |
| /// ibAdvanced control. |
| /// </summary> |
| /// <remarks> |
| /// Auto-generated field. |
| /// To modify move field declaration from designer file to code-behind file. |
| /// </remarks> |
| protected global::System.Web.UI.WebControls.ImageButton ibAdvanced; |
| |
| /// <summary> |
| /// rcmSearchMenu control. |
| /// </summary> |
| /// <remarks> |
| /// Auto-generated field. |
| /// To modify move field declaration from designer file to code-behind file. |
| /// </remarks> |
| protected global::Telerik.Web.UI.RadContextMenu rcmSearchMenu; |
| } |
| } |
| |
| |
| ===> styles.css |
| |
| |
| body |
| { |
| font-family: Verdana; |
| font-size: 8pt; |
| } |
| |
| .clearfix:after |
| { |
| content: "."; |
| display: block; |
| height: 0; |
| clear: both; |
| visibility: hidden; |
| } |
| |
| .clearfix |
| { |
| display: inline-block; |
| } |
| |
| |
| div.RadMenu_Vista .rmRootGroup |
| { |
| background-color: White !important; |
| border: 1px solid White; |
| } |
| |
| |
| div.RadMenu_Vista .rmRootGroup .advSearch-m |
| { |
| /*background: transparent url('./Images/icons/16/view.gif') no-repeat 0 0 !important;*/ |
| text-decoration: none !important; |
| background-color: White !important; |
| font-size: 10px; |
| color: Blue; |
| } |
| |
| div.RadMenu_Vista .rmRootGroup .advSearch-m:hover |
| { |
| /*background: transparent url('./Images/icons/16/view.gif') no-repeat 0 0 !important;*/ |
| text-decoration: none !important; |
| background-color: White !important; |
| font-size: 10px; |
| color: Blue; |
| } |
| |
| div.RadMenu_Vista .rmGroup |
| { |
| text-decoration: none !important; |
| background-color: White !important; |
| } |
| |
| |
| div.RadMenu_Vista .rmGroup li.advSearch |
| { |
| text-decoration: none !important; |
| background: transparent url('images/Cancel.gif'); |
| background-color: White !important; |
| width: 600px; |
| font-size: 10px; |
| } |
| |
| |
| div.RadMenu_Vista .rmGroup a.advSearch-button |
| { |
| display:inline-block; |
| background: transparent url('images/login.png') no-repeat 0 0; |
| } |
| |