Add Menu Panel Dynamically in Panel

  1. #1

    Add Menu Panel Dynamically in Panel

    Hello

    I am working with Ext.NET Controls in My Application..I want Dynamic MenuPanel in Panel.
    I had try out some code its not showing Menu and Menu Item.

    So any One having any Idea Please Help ME


    Thanks

    With Regards,
    Archana Mistry
  2. #2
    Hi,

    Please look at the example.

    Example

    <%@ Page Language="C#" %>
    
    <%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
    
    <script runat="server">
        protected void AddMenuPanel(object sender, DirectEventArgs e)
        {
            MenuPanel mp = new MenuPanel();
            mp.Menu.Add(new Ext.Net.MenuItem("Item 1"));
            mp.Menu.Add(new Ext.Net.MenuItem("Item 2"));
            mp.Menu.Listeners.ItemClick.Handler = "alert(menuItem.text);";
    
            this.Panel1.Items.Add(mp);
    
            mp.Render();
        }
    </script>
    
    <!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 runat="server">
        <title>Ext.Net Example</title>
    </head>
    <body>
        <form runat="server">
            <ext:ResourceManager runat="server" />
            <ext:Panel 
                ID="Panel1" 
                runat="server" 
                Width="200" 
                Height="100" 
                Layout="FitLayout" />
            <ext:Button runat="server" Text="Add MenuPanel" OnDirectClick="AddMenuPanel" />
        </form>
    </body>
    </html>
  3. #3
    Hello,
    I'm working on Asp.Net MVC, I want to create an Ext.Net component from action method, it did not work ...
    This is my action :
    public ActionResult Index()
           {
               Button b = new Button();
               b.Text = "test";
               b.ID = "test1";
               ViewData["Button"] = b;
               return View();
           }
    This is the view page :
    <%@ Page Language="C#" Inherits="System.Web.Mvc.ViewPage" %>
     
    <%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
    <!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 runat="server">
        <title>Index</title>
    </head>
    <body>
        <ext:ResourceManager ID="ResourceManager1" runat="server" IDMode="Explicit" />
        <div>
            <% Ext.Net.Button b = (Ext.Net.Button)ViewData["Button"];
            
               b.Show();
            %>
        </div>
    </body>
    </html>
  4. #4
    Hi,

    Please start a new forum thread.
  5. #5
    Quote Originally Posted by Daniil View Post
    Hi,

    Please start a new forum thread.
    http://forums.ext.net/showthread.php...the-controller
    DONE !

Similar Threads

  1. Replies: 2
    Last Post: Apr 02, 2012, 7:48 AM
  2. Replies: 0
    Last Post: Mar 27, 2012, 10:01 AM
  3. Add Menu Panel Dynamically in Panel
    By archana in forum 1.x Help
    Replies: 2
    Last Post: Oct 14, 2011, 9:53 AM
  4. Ext .net Menu Panel dynamically created
    By garag in forum 1.x Help
    Replies: 1
    Last Post: Oct 14, 2011, 9:50 AM
  5. Replies: 0
    Last Post: Nov 12, 2010, 2:52 AM

Tags for this Thread

Posting Permissions