Back To Start Of Archive
Taken From The Forum: Windows Menu Builder
Forum Topic: Click to view post
Last Updated: Saturday July 14 2012 - 06:07:25
Visual Studio .NET 2003 Web Control for Milonic Menu
Poster: thlucas
Dated: Tuesday June 8 2004 - 21:24:36 BST
I have created a VS.NET Toolbox add-in for the Milonic Menu, in case anyone else is doing .NET development using the menu. The controls generate the standard Javascript that you're used to coding already, it's just a friendlier interface that integrates into the VS.NET IDE. It is still in the Beta phase, but I would like to get some feedback from others to see if they would find something like this useful - who knows, maybe even try to sell it if there is enough interest!
Some features of the controls include:
1) ASP.NET Postback support for each menu control.
2) Unlimited # of menu / style controls.
3) Seamless integrations into the VS.NET IDE.
4) Standard VS.NET property browsers are used to control properties.
5) Static property values are enumerated.
6) Configurable paths to supporting Milonic Javascripts.
The only thing I could not get to work (yet) is the positioning within a table - other than that I think everything else is supported.
Anyone interested?
Poster: Andy
Dated: Tuesday June 8 2004 - 22:35:41 BST
Excellent - do you have any working demos for us to see.
Cheers
Andy
ASP.NET Code Samples for Menu Control
Poster: thlucas
Dated: Wednesday June 9 2004 - 13:23:24 BST
I can send you some screen captures if you like, or if you're an ASP.NET developer I can send you the control for you to try it out. I don't think I can attach screen captures to the forum messages - if there's a way let me know.
I don't have any licensing scheme built into the controls, but you will need the Milonic license of course. I developed the control using the .NET Framework v1.1, using VS.NET 2003 IDE. I'm sure it could be recompiled for the 1.0 framework without any problem, but have not tested it with any other versions beside 1.1.
The controls can also be created dynamically in the ASP.NET codebehind file. The following are code samples that demonstrate how to create a Milonic Menu dynamically from ASP codebehind, including how to handle PostBack events.
Code:
#Region " Web Form Designer Generated Code "
...
' create new menu control objects.
Protected WithEvents DynamicMenu As New C3WebControls.C3Menu
Protected DynamicMenuStyle As New C3WebControls.C3MenuStyle
...
#End Region
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
' create new menu style control.
DynamicMenuStyle.ID = "C3DynamicStyle"
DynamicMenuStyle.Theme = C3WebControls.C3MenuStyle_ThemeValues.Macintosh
Page.Controls.Add(DynamicMenuStyle)
' create new menu control.
DynamicMenu.ID = "C3DynamicMenu"
DynamicMenu.MenuStyle = DynamicMenuStyle.ID
DynamicMenu.Left = Unit.Parse("10")
DynamicMenu.Top = Unit.Parse("10")
Page.Controls.Add(DynamicMenu)
' add new items to menu.
Dim item1 As New C3WebControls.C3MenuItem
item1.Text = "Dynamic Menu Item 1"
item1.URL = "http://www.yahoo.com"
DynamicMenu.MenuItems.Add(item1)
Dim item2 As New C3WebControls.C3MenuItem
item2.Text = "Dynamic Menu Item 2"
item2.PostBackData = "This is PostBack Data for an ASP Postback event"
DynamicMenu.MenuItems.Add(item2)
End Sub
Private Sub C3DynamicMenu_ItemClick(ByVal sender As System.Object, ByVal e As C3WebControls.C3MenuItemClickEventArgs) Handles DynamicMenu.ItemClick
' Handle PostBack event for Dynamic Menu Control.
Dim sMenuID As String = e.MenuID
Dim sMenuItemText As String = e.MenuItemText
Dim sMenuItemURL As String = e.MenuItemURL
Dim sMenuItemPostbackData As String = e.EventData
Dim sControlItemIndex As String = e.ControlItemIndex
Dim sControlUniqueIDD As String = e.ControlUniqueID
End Sub
Integrating Menu with ASP.NET DataGrid Items
Poster: thlucas
Dated: Wednesday June 9 2004 - 13:37:50 BST
I almost forgot - the control can also be integrated with the ASP.NET DataGrid control to allow popup menus to be displayed for each item in a datagrid. You simply define the menu control, then hook the DataGrid ItemDataBound event to insert the appropriate DHTML events to display / hide the popup menu. The PostBack event data contains the DataGrid row number and control ID for referencing in the codebehind file - or invoke Javascript(s) right from the client side!
Code:
Private Sub DataGrid1_ItemDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.DataGridItemEventArgs) Handles DataGrid1.ItemDataBound
' Only process if we are NOT dealing with a Header or Footer row:
If e.Item.ItemType = ListItemType.Header _
Or e.Item.ItemType = ListItemType.Footer Then
Else
Dim oCell As Object = e.Item.Cells(0)
' add menu events and data for postback functionality:
oCell.Attributes("MnuControlUniqueID") = Replace(oCell.UniqueID, ":", "$")
oCell.Attributes("MnuControlItemIndex") = e.Item.ItemIndex
' change cursor and background color when mouse is moved over cell 0.
oCell.Attributes("onmouseenter") = "_mnuObjectStyle=this.style.cssText; this.style.cursor='hand'; this.style.background='#cccccc';"
oCell.Attributes("onmouseleave") = "this.style.cssText=_mnuObjectStyle;"
' display popup menu when user right-clicks over cell 0.
oCell.Attributes("oncontextmenu") = "_mnuObject=this; popup('C3Menu1',1); return false;"
' display popup menu when user left-clicks over cell 0.
'oCell.Attributes("onclick") = "_mnuObject=this; popup('C3Menu1',1);"
End If
End Sub
Milonic Menu - Asp .Net
Poster: yh_rose
Dated: Wednesday February 23 2005 - 22:09:45 GMT
Thlucas,
Can I have a copy of what you have developed?
Thanks,
Rose
Re: ASP.NET Code Samples for Menu Control
Poster: John
Dated: Thursday February 24 2005 - 13:43:55 GMT
thlucas wrote:
I can send you some screen captures if you like, or if you're an ASP.NET developer I can send you the control for you to try it out. I don't think I can attach screen captures to the forum messages - if there's a way let me know.
Put the shot on your server, then use the img tag to point to it with a standard URL. Just try not to make it too frippin' big...
Code:
[img]http://my.server.com/images/shot.gif[/img]
Poster: Ruth
Dated: Friday February 25 2005 - 7:14:22 GMT
Just for information, because I'm not sure anyone noticed, but this was posted originally in June of 2004 and thlucas hasn't posted anything else since. With the server changes, maybe he/she is not receiving any topic updates?
Ruth
Screen Snapshot
Poster: thlucas
Dated: Friday February 25 2005 - 16:40:59 GMT
The following screenshot shows a web-application that is using the Menu in a ASP.NET DataGrid. The menu items were added dynamically using code similar to what was posted in a previous process.
Send me your email addy and I'll send you the control - my email addy is thlucas -at - yahoo.com
Thanks - Todd
deleted the screenshot - added another post with a live demo.
thlucas - 3/1/2005 11:16am cst
Poster: John
Dated: Monday February 28 2005 - 2:07:26 GMT
Ruth wrote:
Just for information, because I'm not sure anyone noticed, but this was posted originally in June of 2004 and thlucas hasn't posted anything else since. With the server changes, maybe he/she is not receiving any topic updates?
Ruth, given this is a new topic, my guess is there was a clock setting 'problem' when Andy was putting the new server up.
Better Example
Poster: thlucas
Dated: Tuesday March 1 2005 - 17:13:15 GMT
Here's a live demo of the control in action:
Milonic Menu Control Demo Site
Download the Demo From Here
Control
Poster: DotNetDoc
Dated: Saturday March 4 2006 - 5:26:33 GMT
I need to populate the menu form the db but need to integreate it into the world map. Do you have some sample code l could see that loops through the dataset table and creates the menu dynamicly?
Thanks for any help.
Daniel
C3WebControls Demo
Poster: thlucas
Dated: Sunday March 5 2006 - 1:20:37 GMT
Hi Daniel,
I put together a .MSI installer file for the sample application. It will install the sample to the (by default) "C:\InetPub\WWWRoot\C3WebControlsDemo" folder and create 2 new virtual directories in the IIS administration console. After completion, you should be able to browse to "http://localhost/c3webcontrolsdemo" to view the page. The demo source is also included in the install directory, which demonstrates how to dynamically create menus from ASP.NET codebehind. Just open the .SLN solution file.
Note that the demo does not show you how to create items from a database, but it should give you enough details to do what you are wanting to do. Basically wrap the menu item creation within a loop that iterates through your dataset rows collection.
The install can be downloaded from our web-site at the following URL:
Download from Here
Please let me know if you have questions ...