Howdy,
If i got you right, you want to achieve something like this:
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
menu.Items.Add(new MenuItem("Go to MST", "http://www.microsoft.com"));
menu.Items.Add(new MenuItem("Go to Amazon", "http://www.amazon.com"));
}
}
protected void menu_MenuItemClick(object sender, MenuEventArgs e)
{
// do something before redirecting ...
// i.e. increase link target website counter
// and redirect
Response.Redirect(e.Item.Value);
}
Remember viewstate of the page/menu has to be enabled
hope this helps
--
Milosz
"**** KiteOregon ****" wrote:
> I have a page with an aspMenu, i am able to handle the menuItem_click event,
> however once i handle the event how do i make the page navigate?
>
> so how do i make the aspMenu control navigate to a URL set in the
> codebehind. I can't use the normal click event. In this case i want to use
> the control, but it's visibility property could be set to false, so how do i
> do the same thing.
>
> This is confusing, maybe better if i could write code to explain what i want.
>
> MenuItem myItem = new MenuItem;
> myItem.NavigateURL = "http://www.url.com";
> myItme.Target = "content";
>
> Menu1.Items.Add(myItem)
>
> ** now i want to call a nav function. **
> ie. Menu1.Items["X"].act_like_i_was_clicked_from_client
>
>
> ok, i think that makes a little more sense.
>
> Thanks
>
> Eric.
> --
> Just another lost developer.....
|