DotNetNewsgroup.com  
web access to complete list of Microsoft.NET newsgroups
   home   |   control panel login   |   archive  |  
 
  carried group
academic
adonet
aspnet
aspnet.announcements
aspnet.buildingcontrols
aspnet.caching
aspnet.datagridcontrol
aspnet.mobile
aspnet.security
aspnet.webcontrols
aspnet.webservices
assignment_manager
datatools
dotnet.distributed_apps
dotnet.general
dotnet.myservices
dotnet.nternationalization
dotnet.scripting
dotnet.security
dotnet.vjsharp
dotnet.vsa
dotnet.xml
dotnetfaqs
framework
framework.clr
framework.compactframework
framework.component_services
framework.controls
framework.databinding
framework.drawing
framework.enhancements
framework.interop
framework.odbcnet
framework.performance
framework.remoting
framework.sdk
framework.setup
framework.webservices
framework.windowsforms
framework.wmi
frwk.windowsforms.designtime
lang.csharp
lang.jscript
lang.vb
lang.vb.controls
lang.vb.data
lang.vb.upgrade
lang.vc
lang.vc.libraries
  
 
start date: Thu, 9 Aug 2007 15:32:51 -0400,    posted on: microsoft.public.dotnet.framework.aspnet        back       

Thread Index
  1    MikeB


Menu User Control & Postback   
Hello All, I have  UserControl that consists of a Menu control.  When a user 
selects an item in the Menu I set a Public variable in the MenuItemClick 
event.  My problem is that when the main webpage posts back, the 
MenuItemClick isn't fired off until after the postback so I can not get it 
and my SelectedCategoryID is always 0.  Can anyone tell me what I am doing 
wrong?  Below are snippets of my code:

MENU.ascx

 private int _CategoryID = 0;

protected void Menu1_MenuItemClick(object sender, MenuEventArgs e)
{
    _CategoryID = Convert.ToInt32(e.Item.Value);
}

public int SelectedCategoryID
{
    get
    {
        return _CategoryID;
    }
}


Then  in my webpage, I have something that checks for the Menu
if (Menus1.SelectedCategoryID != 0)
{}
else
{}
Date:Thu, 9 Aug 2007 15:32:51 -0400   Author:  

Google
 
Web dotnetnewsgroup.com


COPYRIGHT ?2005, EUROFRONT WORLDWIDE LTD., ALL RIGHT RESERVE  |   Contact us