webcombo-Webmenu

6 replies. Last post: October 27, 2009 10:28 PM by Yudi
Tags :
  • New Discussion
  • New Question
  • New Product Feedback

I am trying to use the webcombo with a webmenu integrated. When I try to populate the webmenu inside an ajax update panel using a button click event the information will not display.  The web menu must have a full page postback for it to update.

What can be done using server side code to update the web menu?

Also, on webmenu click, even in a ajax update panel, the page does a full page postback not a ajax postback. How do I avoid full page postback on menu click for server side code to be called?

 

//c# code:**********

 private void BucketMenu(ref WebContextMenu x, bool checkVRDS)
    {
        x.Menu.Items.Clear();
        cmdPackage cmd = new cmdPackage();

        WebMenuItem mi;

        DataTable dt = cmd.fillVDIhandoffBucketTable("Userid", "East", cmdPackage.vdiBucketSearch.vdiwf);

        string isMCO = checkVRDS == true ? " " : "MCO";

        var query =
         from order in dt.AsEnumerable()
         where order.Field<string>("Center") != isMCO
         orderby order.Field<string>("Center")
         group order by order.Field<string>("Center") into g


         //var query =
         // from order in dt.AsEnumerable()       
         // orderby order.Field<string>("Center")
         // group order by order.Field<string>("Center") into g

         select new
         {
             name = g.Key,


         };

        foreach (var order in query)
        {
            mi = new WebMenuItem(order.name, order.name);


            WebMenuItemCollection usaItems = mi.Items;// WebContextMenu1.Items.GetNamedItem(order.name).Items;
            x.Menu.Items.Add(mi);

            //WebMenuItemCollection usaItems;
            DataRow[] usaRows = dt.Select("Center =  '" + order.name + "'");

            foreach (DataRow row in usaRows)
            {

                WebMenuItem item = new WebMenuItem(row["Bucket_Name"].ToString());
                item.Tag = row["BucketID"].ToString();
                //item.ImageURL = "images/" + item.Text + ".jpg";

                usaItems.Add(item);

            }
        }
    }


    protected void Button1_Click(object sender, EventArgs e)
    {
        BucketMenu(ref WebContextMenu1, false);
  
    }


//Asp.net

<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
        <asp:ScriptManager ID="ScriptManager1" runat="server">
        </asp:ScriptManager>
      
       
      
        <asp:UpdatePanel ID="UpdatePanel1" runat="server">
            <contenttemplate><asp:Button ID="Button1" runat="server" onclick="Button1_Click" Text="Button" />
           <iswebcombo:webcombo ID="WebCombo2" runat="server"
                UseDefaultStyle="true">
                <IntegrationSettings ControlId="WebContextMenu1" Enabled="True" />
            </ISWebCombo:WebCombo>
          
      
           
           
            <ISWebDesktop:WebContextMenu ID="WebContextMenu1" runat="server" AutoPostBack="Yes">
               
                <MenuStyleSettings BackgroundStripColor2="SteelBlue">
                </MenuStyleSettings>
               
            </ISWebDesktop:WebContextMenu>
     </contenttemplate>
        </asp:UpdatePanel>
       
       
       
</asp:Content>

 

All times are GMT -5. The time now is 3:36 PM.
Previous Next