CodeVerge.Net Beta


   Explore    Item Entry   Register  Login  
Microsoft News
Asp.Net Forums
IBM Software
Borland Forums
Adobe Forums
Novell Forums

ASP.NET Web Hosting – 3 Months Free!



Zone: > NEWSGROUP > Asp.Net Forum > general_asp.net.master_pages_themes_and_navigation_controls Tags:
Item Type: NewsGroup Date Entered: 8/30/2007 1:30:47 PM Date Modified: Subscribers: 0 Subscribe Alert
Rate It:
(NR, 0)
XPoints: N/A Replies: 6 Views: 67 Favorited: 0 Favorite
Can Reply:  No Members Can Edit: No Online: Yes
7 Items, 1 Pages 1 |< << Go >> >|
Mokles
Asp.Net User
Nested Master Page event handling sequence problem8/30/2007 1:30:47 PM

0/0

Hi All,

I have two master pages, one nested in another. In outer master page, there is a dropdown list and in the inner master page there is a drop down list.

I populate the Inner master page when the user changes selection in the outer master page, using the SelectedIndexChange event.  But what I am finding is that the dropdown list in the Inner master page is always one step behind. The populating of the dropdownlist in Inner Master page is happening before the outer master page's Selection is changed. So, the populating of the Inner Master page is using the old value.

Any idea, how to remedy this issue. Thanks,

Mokles 

naturehermit
Asp.Net User
Re: Nested Master Page event handling sequence problem8/30/2007 1:58:57 PM

0/0

Could I have a look as to how you are doing it?


Please Mark Post that helped you as answer, also include a summary of what solved the problem as it helps others in similar situations
Mokles
Asp.Net User
Re: Nested Master Page event handling sequence problem8/30/2007 9:14:43 PM

0/0

I am off for 4 days. I will post the code next Tuesday when I am in office.

Thanks,

Mokles 

Amanda Wang - M
Asp.Net User
Re: Nested Master Page event handling sequence problem9/3/2007 7:45:00 AM

0/0

Hi Mokles,

As your above description, you want to change the dropdownlist's selectedtem in the inner master page according by the outer master page's dropdownlist Selection is changed,right?

Below is my solution,  create a base master page class which inherits the System.Web.UI.Masterpage, and define a virtual property ddl, its type is dropdownlist, make the inner master page inherit this base class and override this property. hope it helps.

1. BaseMasterpage codebehind.

public class BaseMasterPage: MasterPage
{
// Define  a virtauls property 
    public virtual DropDownList ddl   // make the inner master page  inherit this property 
    {
        get
        {
            return null;
        }
    }
public BaseMasterPage()
{
	//
	// TODO: Add constructor logic here
	//
}
}
2. Innner master page codebehind:
 
public partial class ChildMasterPage : BaseMasterPage// Inherit from the BaseMaster page class
{
    public override DropDownList ddl// override the virtual property of the Basemasterpage class
    {
        get
        {
            return this.ddlChilde;
        }
    }
.................
}
  3.Outer maser page codebehind:
    BaseMasterPageCurrentpage = null;
    protected void Page_Load(object sender, EventArgs e)
    {
        Currentpage =  Page.Master  as  BaseMasterPage;
    }

    protected void ddlParent_SelectedIndexChanged(object sender, EventArgs e)// the SelectedIndexChanged even of the dropdownlist on the outer master page
    {
        if (Currentpage != null)
        {
	// Change the inner dropdownlist's selectedindex
            if (this.ddlParent.SelectedItem.Value == "A")
            {
                Currentpage.ddl.SelectedIndex = 1;
            }
            else if (ddlParent.SelectedItem.Value == "B")
            {
                Currentpage.ddl.SelectedIndex = 2;
            }
            else if (ddlParent.SelectedItem.Value == "C")
            {
                Currentpage.ddl.SelectedIndex = 3;
            }
        }
    }
 

Please remember to mark the replies as answers if they help and unmark them if they provide no help.


Yours sincerely,
Amanda Wang
Microsoft Online Community Support
Mokles
Asp.Net User
Re: Nested Master Page event handling sequence problem9/6/2007 6:19:01 PM

0/0

I tried to use the inherited master page as the inner master page as suggested.

In the outer master page codebehind I have:

        BaseMasterPage Currentpage = null;

        protected void Page_Load(object sender, EventArgs e)
        {        Currentpage =  (BaseMasterPage) Page.Master ;}

but it seems the outer master page should not have any page.master class, as it does not have any master page.

Another issue is  the codebehind of the inner master page can not find the drop down list control ddlAccessiblePlayer, that has been defined in the inner master page as below:

                <asp:DropDownList ID="ddlAccessiblePlayer" runat="server" OnSelectedIndexChanged="ddlAccessiblePlayer_SelectedIndexChanged" AutoPostBack="true"> </asp:DropDownList>

 In the code behind of the inner master page I have:

        public override DropDownList  ddl// override the virtual property of the Basemasterpage class
        {
            get
            {
                return this.ddlAccessiblePlayer;
            }
        }

 The error I am getting: 'DeliveryManagement.DeliveryManagementMaster' does not contain a definition for 'ddlAccessiblePlayer'   

DeliveryManagementMaster is the name of the inner master page.

Thanks for your attention.

Mokles 

Amanda Wang - M
Asp.Net User
Re: Nested Master Page event handling sequence problem9/7/2007 4:40:28 AM

0/0

Hi,

Mokles:

but it seems the outer master page should not have any page.master class, as it does not have any master page.

The page is not the master page, it is the content page. the page.master is the inner master, the page.master.master is the outer master page.

Mokles:

Another issue is  the codebehind of the inner master page can not find the drop down list control ddlAccessiblePlayer, that has been defined in the inner master page as below:

                <asp:DropDownList ID="ddlAccessiblePlayer" runat="server" OnSelectedIndexChanged="ddlAccessiblePlayer_SelectedIndexChanged" AutoPostBack="true"> </asp:DropDownList>

 In the code behind of the inner master page I have:

        public override DropDownList  ddl// override the virtual property of the Basemasterpage class
        {
            get
            {
                return this.ddlAccessiblePlayer;
            }
        }

 The error I am getting: 'DeliveryManagement.DeliveryManagementMaster' does not contain a definition for 'ddlAccessiblePlayer'   

DeliveryManagementMaster is the name of the inner master page.

You only need to override the dropdownlist that is on the inner master page?  Did you put the two dropdownlists on the master page?

In test project, I have two dropdownlist controls, one is on the outer master page, the other is on the inner master page.

 


Please remember to mark the replies as answers if they help and unmark them if they provide no help.


Yours sincerely,
Amanda Wang
Microsoft Online Community Support
Mokles
Asp.Net User
Re: Nested Master Page event handling sequence problem9/7/2007 6:57:50 PM

0/0

Although the basemasterpage and inheritance of that, may work, I found another way.  Read article:

http://aspnet.4guysfromrolla.com/articles/013107-1.aspx

Although the article about passing information from the master page to the content page, it will work for outer master page and inner master page. The outer master page is loosely coupled with the inner  master page, which is good design.

Thanks all for the support.

Mokles 

7 Items, 1 Pages 1 |< << Go >> >|


Free Download:


Web:
CodeProject: Inheritance and Nested Master Pages. Free source code ... BTW: VS 2008 Beta 2 seems to be ok and handles nested master pages ... you that problem described above related with "event sequence" I'd say "life cycle". ...
Nested Master Pages Blues - ASP.NET Forums Nested Master Pages Blues. Last post 08-25-2005 10:17 PM by mcpayne. ... ( thought I was still dealing with the event sequence problem). ...
Technical on Satellite Site: Master Pages: Tips, Tricks, and Traps Event Sequence. · Content Page to Master Page Interaction .... content page uses a nested master page design, the designer will display an error message. ...
@ Master Indicates whether simple event handlers can be defined for specific life ... used in a master page when defining a child master page in a nested master-page ...
Nested Master Pages Blues - ASP.NET Forums PS I have tried firing the logic in root.master's page_init event, no luck. ... issue (thought I was still dealing with the event sequence problem). ...
Master Pages in ASP.NET 2.0 The list below shows the sequence of events in a content page that references a ... Nested master pages are very useful while designing Web sites with ...
.NET ASP Page 48 - Bytes Site Map Writing to a registered source in the Application event log with I ... HttpHandler Problem in ASP .net 2.0 · Dynamically setting a MasterPage's tag ...
Master pages: Page_Load is backwards This is the sequence of events that get fired when a content page is merged with a master: Master page controls Init event ...
Master Pages and Navigation chitecture allows for nested master pages, where a master page can have a ..... control to a page provides all that’s needed for site map handling, ...
Event Handlers in Business Process Choreographer Mar 31, 2006 ... The event handler contains a nested scope called NestedScope . ..... event handler instances that contain an invoke-receive sequence to deal ...




Search This Site:










javascript - masterpage - help

problems navigating links from menu to contentplaceholder

treeview not displaying correct expand, collapse and no expand images

compatibility problems between master pages and freetextbox??

webresource.axd problem in menu control

trying to create an image gallery within a masterpage

theme please help

refresh a content page without refreshing master page

controls inside contentplaceholder have id's modified

i'm trying to build a blog builder , what is the best way to make multi style to the blogs?

system.web.administration.navigationbar

how to make child links to my "admin" link on the master page?

display image while page is loading

can i control the tools place at master page?

asp.net 2.0 treeview javascript help...

change css on mouseclick

menu fixed at the top when scrolling down?

masterpage

cannot apply style/skin to usercontrol please help

help with file.io

masterpage element or server control definitions?

menu with too many items

dynamic menu control without using sitemap

how can i set the color of an item template in a skin file

how to set css class of body in code?

help with adding a webcontrol table at runtime to a placeholder control of a masterpage.

css hyperlinks overpowering my menu control

menu control with sitemap problem?

menu control logout

error image appearance in masterpage

  Privacy | Contact Us
All Times Are GMT