Visual Studio .NET 2003 Web Control for Milonic Menu

A Windows application for making menus
Post Reply
thlucas
Beginner
Beginner
Posts: 9
Joined: Mon Nov 18, 2002 5:12 pm

Visual Studio .NET 2003 Web Control for Milonic Menu

Post by thlucas »

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?
User avatar
Andy
Milonic
Milonic
Posts: 3308
Joined: Sun May 19, 2002 8:23 pm
Location: Menu Developer
Contact:

Post by Andy »

Excellent - do you have any working demos for us to see.

Cheers
Andy
thlucas
Beginner
Beginner
Posts: 9
Joined: Mon Nov 18, 2002 5:12 pm

ASP.NET Code Samples for Menu Control

Post by thlucas »

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: Select all


#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

thlucas
Beginner
Beginner
Posts: 9
Joined: Mon Nov 18, 2002 5:12 pm

Integrating Menu with ASP.NET DataGrid Items

Post by thlucas »

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: Select all


	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

yh_rose
Beginner
Beginner
Posts: 1
Joined: Wed Feb 23, 2005 9:53 pm

Milonic Menu - Asp .Net

Post by yh_rose »

Thlucas,

Can I have a copy of what you have developed?

Thanks,

Rose
User avatar
John
 Team
 Team
Posts: 5967
Joined: Sun May 19, 2002 8:23 pm
Location: Phoenix, AZ
Contact:

Re: ASP.NET Code Samples for Menu Control

Post by John »

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... :D

Code: Select all

[img]http://my.server.com/images/shot.gif[/img]
John
User avatar
Ruth
 Team
 Team
Posts: 8763
Joined: Thu May 15, 2003 5:02 am
Location: Yucaipa, CA
Contact:

Post by Ruth »

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
thlucas
Beginner
Beginner
Posts: 9
Joined: Mon Nov 18, 2002 5:12 pm

Screen Snapshot

Post by thlucas »

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
Last edited by thlucas on Tue Mar 01, 2005 6:19 pm, edited 1 time in total.
User avatar
John
 Team
 Team
Posts: 5967
Joined: Sun May 19, 2002 8:23 pm
Location: Phoenix, AZ
Contact:

Post by John »

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.
John
thlucas
Beginner
Beginner
Posts: 9
Joined: Mon Nov 18, 2002 5:12 pm

Better Example

Post by thlucas »

Here's a live demo of the control in action:

Milonic Menu Control Demo Site

Download the Demo From Here
Last edited by thlucas on Sun Mar 05, 2006 2:22 am, edited 2 times in total.
DotNetDoc
Beginner
Beginner
Posts: 2
Joined: Sat Mar 04, 2006 5:30 am

Control

Post by DotNetDoc »

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
thlucas
Beginner
Beginner
Posts: 9
Joined: Mon Nov 18, 2002 5:12 pm

C3WebControls Demo

Post by thlucas »

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 ...
Post Reply