Access url from a Toolbar Menu

  1. #1

    Access url from a Toolbar Menu

    Hello,

    I need to access a URL from a Toolbar Menu

    I'm doing the following:

    Dim MenuNivelItem As MenuItem = New MenuItem()
    
    MenuNivelItem.DirectEvents.Click.Url = Trim(cnxNivelItem.drListagem(7).ToString())
    The error message returned is:

    Application Server Error in '/ Prj-Studies'.

    Validation of Viewstate MAC failed. If this application is hosted on a Web farm or cluster, ensure that configuration specifies the same <machineKey> same validationKey and validation algorithm. AutoGenerate can not be used in a cluster.

    Note: the URL captured from the database is "page.aspx"

    Has anyone experienced this?

    Thanks
  2. #2
    Hi danilo,

    Please clarify what are you trying to achieve? What does "I need to access a URL" mean?
  3. #3
    I want to open a url in the click of a MenuItem ()

    realized two unsuccessful attempts

    1. MenuNivelItem.DirectEvents.Click.Url = "https://examples1.ext.net"

    2. MenuNivelItem.PostBackUrl = "https://examples1.ext.net"

    what could be wrong?

    Thanks!
    Last edited by danilo; Nov 07, 2010 at 1:37 PM.
  4. #4
    Hi danilo,

    Please look at the example.

    Example
    <%@ Page Language="C#" %>
    
    <%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
    
    <script runat="server">
        protected void LoadExtNet(object sender, DirectEventArgs e)
        {
            Window1.AutoLoad.Url = "http://ext.net";
            Window1.AutoLoad.Mode = LoadMode.IFrame;
            Window1.AutoLoad.ShowMask = true;
            Window1.Render();
        }
    
        protected void LoadGoogle(object sender, DirectEventArgs e)
        {
            Window1.AutoLoad.Url = "http://google.com";
            Window1.AutoLoad.Mode = LoadMode.IFrame;
            Window1.AutoLoad.ShowMask = true;
            Window1.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:Window 
            ID="Window1" 
            runat="server" 
            Title="Test Window" 
            Width="500" 
            Height="500">
            <TopBar>
                <ext:Toolbar runat="server">
                    <Items>
                        <ext:Button runat="server" Text="Load">
                            <Menu>
                                <ext:Menu runat="server">
                                    <Items>
                                        <ext:MenuItem ID="MenuItem1" runat="server" Text="ext.net">
                                            <DirectEvents>
                                                <Click OnEvent="LoadExtNet" />
                                            </DirectEvents>
                                        </ext:MenuItem>
                                        <ext:MenuItem ID="MenuItem2" runat="server" Text="google.com">
                                            <DirectEvents>
                                                <Click OnEvent="LoadGoogle" />
                                            </DirectEvents>
                                        </ext:MenuItem>
                                    </Items>
                                </ext:Menu>
                            </Menu>
                        </ext:Button>
                    </Items>
                </ext:Toolbar>
            </TopBar>
        </ext:Window>
        </form>
    </body>
    </html>

Similar Threads

  1. about toolbar menu
    By Egale in forum 1.x Help
    Replies: 7
    Last Post: Jul 12, 2011, 1:42 PM
  2. Menu + Toolbar
    By Dominik in forum 1.x Help
    Replies: 8
    Last Post: Apr 15, 2010, 4:35 AM
  3. toolbar: drop down menu
    By Kamal in forum 1.x Help
    Replies: 3
    Last Post: Dec 22, 2009, 5:13 AM
  4. access to item of menu in Coolite desktop
    By mono in forum 1.x Help
    Replies: 0
    Last Post: Aug 10, 2009, 11:50 AM
  5. Toolbar menu click problem?
    By dbassett74 in forum 1.x Help
    Replies: 1
    Last Post: Apr 19, 2009, 2:55 AM

Posting Permissions