PC Review


Reply
 
 
=?Utf-8?B?KioqKiBLaXRlT3JlZ29uICoqKio=?=
Guest
Posts: n/a
 
      28th Jan 2007
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.....
 
Reply With Quote
 
 
 
 
=?Utf-8?B?TWlsb3N6IFNrYWxlY2tpIFtNQ0FEXQ==?=
Guest
Posts: n/a
 
      29th Jan 2007
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.....

 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
aspmenu require click to activate =?Utf-8?B?cGlja2VkYW5hbWU=?= Microsoft ASP .NET 2 6th Mar 2007 11:26 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:43 PM.