CodeVerge.Net Beta


   Explore    Item Entry   Register  Login  
web_forms
getting_started
data_presentation_controls
dotnetnuke
data_access-sql_server_sql_server_express_and_sqldatasource_control
security
client_side_web_development
novell-support-groupwise-6x-clients
data_access-data_access_and_objectdatasource_control
asp-net_ajax-asp-net_ajax_control_toolkit
novell-support-netware-6x-install-upgrade
asp-net_ajax-asp-net_ajax_discussion_and_suggestions
novell-support-netware-6x-administration-tools
master_pages_themes_and_navigation_controls
configuration_and_deployment
novell-support-netware-client-winnt-2x-xp
novell-support-groupwise-7x-clients
asp-net_ajax-asp-net_ajax_ui
novell-support-edirectory-netware
community-free_for_all
visual_studio_2005
novell-support-groupwise-6x-install-setup
data_access-xml_and_xmldatasource_control
control-cancel
novell-support-iprint
advanced_asp-net-crystal_reports
data_access-xml_web_services
microsoft-public-access
novell-community-chat
state_management
novell-support-netware-6x-abends-hangs
dotnetnuke-getting_started
novell-support-groupwise-6x-gwia
-net_languages-c
novell-support-identity-manager-engine-drivers
novell-support-groupwise-discontinued
advanced_asp-net-architecture
opensuse-org-suse-linux-support-install-configure-administration
dotnetnuke-custom_modules
novell-support-groupwise-7x-install-setup-admin
novell-support-netware-6x-storage-media
novell-support-groupwise-6x-agents
installation_and_setup
data_access-access_databases_and_accessdatasource_control
windows-hosting_open_forum
visual_web_developer_2005_express
novell-support-groupwise-6x-web-access
novell-support-netware-6x-server-backup
macromedia-dreamweaver
novell-support-netware-5x-administration-tools
novell-support-ifolder
novell-support-bordermanager-install-setup
novell-support-imanager
microsoft-public-dotnet-framework-aspnet
novell-support-netware-5x-install-upgrade
novell-support-cluster-services
novell-support-bordermanager-proxies
novell-support-newsflash
advanced_asp-net-sql_server_reporting_services
microsoft-public-dotnet-languages-csharp
web_parts_and_personalization
about_this_site-feedback_on_this_website
ibm-software-websphere-portal-server
novell-support-netware-dns-dhcp
novell-support-zenworks-desktops-4x-app-launcher
-net_languages-visual_basic_-net
advanced_asp-net-custom_server_controls
novell-support-bordermanager-vpn
novell-support-ndps-neps
microsoft-public-sqlserver-programming
novell-support-netware-webserver
community-jobs
novell-support-netware-4x
advanced_asp-net-mobile_and_handheld_devices
internet_explorer_web_controls
novell-support-zenworks-desktops-4x-install-setup
novell-support-edirectory-linux
novell-support-groupwise-7x-gwia
development_tools-web_matrix_general_discussions
microsoft-public-access-formscoding
macromedia-flash
community-announcements
portal_starter_kit
novell-support-zenworks-desktops-4x-management-agent
novell-support-zenworks-patch-management
novell-support-native-file-access
microsoft-public-access-queries
microsoft-public-access-forms
novell-support-groupwise-7x-web-access
novell-support-netware-small-business-6x
data_access-active_directory_and_ldap
novell-support-edirectory-windows
novell-support-groupwise-7x-agents
novell-support-ichain
data_access-oracle
novell-support-zenworks-desktop-management-6x-imaging
novell-support-groupwise-7x-wireless
novell-support-netware-5x-abends-hangs
advanced_asp-net-localization
novell-support-zenworks-desktop-management-7x-imaging-server-nw-win




Can Reply:  No Members Can Edit: No Online: Yes
Zone: > Asp.Net Forum > general_asp.net.master_pages_themes_and_navigation_controls Tags:
Item Type: Date Entered: 2/18/2008 2:09:50 PM Date Modified: Subscribers: 0 Subscribe Alert
Rate It:
NR
XPoints: N/A Replies: 2 Views: 72 Favorited: 0 Favorite
3 Items, 1 Pages 1 |< << Go >> >|
"Boris2" <>
NewsGroup User
Reload masterpage after MenuItem_Click2/18/2008 2:09:50 PM

0

Hi,

I have a masterpage with a simple asp:Menu
Whenever a certain menuItem is clicked, I have to unload some session variables and reload the page so that the content pages can run their BuildPage methods (which get triggered in the Page_Load.

    protected void MenuItemClick(object sender, MenuEventArgs e)
    {
        Country = null;
        Language = null;
        e.Item.Selected = true;
        switch (((Menu)sender).SelectedItem.Value)
        {
            case "technicalDataSheets": Session["action"] = Actions.tds;
                break;
            case "safetyDataSheets": Session["action"] = Actions.tds;
                break;
            default:
                break;
        }
    }
After the switch something DoPostback like would be needed I guess.
But I don't really know how to do that. Any help?
Boris
"orzeh" <>
NewsGroup User
Re: Reload masterpage after MenuItem_Click2/18/2008 2:37:18 PM

0

 hi!

define event in masterpage and handle it in content pages calling BuildPage methods:

*.master.cs:

public event EventHandler SessionVarsChanged;


protected void MenuItemClick(object sender, MenuEventArgs e)
{
Country = null;
Language = null;
e.Item.Selected = true;
switch (((Menu)sender).SelectedItem.Value)
{
case "technicalDataSheets": Session["action"] = Actions.tds;
break;
case "safetyDataSheets": Session["action"] = Actions.tds;
break;
default:
break;
}
      if (SessionVarsChanged != null)

            SessionVarsChanged(this, EventArgs.Empty);

}

 

in content pages:

protected override void OnLoad(EventArgs e)
    {

        (Master as MyMasterPageType).SessionVarsChanged += new EventHandler(SessionVarsChangedHandler);
    }

    void SessionVarsChangedHandler(object sender, EventArgs e)
    {
        BuildPage();
    }

 

or use Server.Transfer() to "reload" whole page.

 

orzeh 


code less, think more!
"Boris2" <>
NewsGroup User
Re: Reload masterpage after MenuItem_Click2/18/2008 3:29:42 PM

0

Indeed, the event is the nicest way I figure. Thanks.
3 Items, 1 Pages 1 |< << Go >> >|


Free Download:













change master page on the fly?

site navigation

disabled controls in theme

need to make bottom level of tree view control not clickable

masterpage split table tags - compile error!

master page error message

code for multiple sitemap providers

new sitemap providers in wss3

how to create database driven menu and submenu , sql database

menu parent should select when child is selected.

timer on controls in master page won't update on member pages

can a masterpage be a popup?

problem with master pages and buttons in inheritance pages

how to overwrite stylesheettheme on webservices pages???

scrolling content

calling java script function from master page

dynamically writing html in the content placeholder

treeview and securitytrimmingenabled

are login controls ok in masterpages?

theming parsed child controls

treeview: how do i display only a part of the site?

accessing web.sitemap in asp.net code behind. is it possible?

broken links when using masterpage

about treeview control in asp.net 2.0

style works great when i don't use masterpage

dynamically expand treeview

events sequence in nested master pages

problem with treeview control inside tabs structure and inside multiview control

masterpages? + postback inside asp:repeater = weird behaviour

treeview control with dhtml and javascript

external links in web.sitemap

i need to dispose/remove/clear sqlsitemapprovider and recreate it

master page with absoulte postioning ???

subdomains and dynamic master pages

displaying menu on left of page, external website on right

menu control (redirect to new window)

masterpage / content holder / problem

skin for programmatically added controls

menu control problem

partial page refresh of content in a master page. possible?

treeview populateondemand very slow

localizing sitemaps

creating theme file on runtime as per the option chosen by user

navigation in master page - is it a good idea?

menuitemclick event not being raised

enter key postback in asp.net 2.0

back button

trouble with xmlsitemapprovider

hierarchical navigation?

programatically changing <meta> information within a master page from a content page

 
Search This Site:

 
  Privacy | Contact Us
All Times Are GMT