|
Step 1: In the Application Explorer, select Presentation Layer, Menu Panels, Menu.ascx. This
displays the menu control in the Design tab. Double-click on the menu item you wish to modify to display
the Page Properties dialog. Select the Bindings tab.
Step 2: Select the "Send custom command" option, enter a command name, and select "Page (Advanced)".
When the menu item is clicked, this custom command will be executed.
Step 3: Select the "Stay on the current page" option.
Step 4: Add the code customization below to the Menu.ascx.cs file, located in:
|
...\<Application Folder>\Menu Panels\Menu.ascx.cs
|
The simple code customization below assumes you are extending the Menu2MenuItem control.
Modify the code customization to suit your needs.
C#:
public Menu()
{
this.Init += new System.EventHandler(myInit);
}
private void myInit(object sender,System.EventArgs e)
{
this.Menu2MenuItem.Button.Click+= new System.EventHandler(Onmenu2MenuItem_Click);
}
private void Onmenu2MenuItem_Click(object sender,System.EventArgs e)
{
if(this.SystemUtils.GetLoginId()=="ALFKI")
{
this.Page.Response.Redirect("http://www.ironspeed.com");
}
else
{
this.Page.Response.Redirect("http://www.gmail.com");
}
}
|
Visual Basic .NET:
Private Sub Page_init(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Init
AddHandler Menu2MenuItem.Button.Click, AddressOf Menu2MenuItem_click
End Sub
Private Sub menu2menuitem_click(ByVal sender As System.Object, ByVal e As System.EventArgs)
If (Me.SystemUtils.GetUserID = "ALFKI") Then
Me.Page.Response.Redirect("Http://www.ironspeed.com")
Else
Me.Page.Response.Redirect("Http://www.hotmail.com")
End If
End Sub
|
Step 5: Build and run your application.
|