CodeVerge.Net Beta


   Explore    Item Entry    Members      Register  Login  
NEWSGROUP
.NET
Algorithms-Data Structures
Asp.Net
C Plus Plus
CSharp
Database
HTML
Javascript
Linq
Other
Regular Expressions
VB.Net
XML

Free Download:




Zone: > NEWSGROUP > Asp.Net Forum > general_asp.net.master_pages_themes_and_navigation_controls Tags:
Item Type: NewsGroup Date Entered: 8/21/2007 9:46:12 PM Date Modified: Subscribers: 0 Subscribe Alert
Rate It:
(NR, 0)
XPoints: N/A Replies: 5 Views: 20 Favorited: 0 Favorite
Can Reply:  No Members Can Edit: No Online: Yes
6 Items, 1 Pages 1 |< << Go >> >|
Frank43
Asp.Net User
Communication ContentPage -> MasterPage8/21/2007 9:46:12 PM

0/0

Hi!

 

I've tried to copy the example from http://fredrik.nsquared2.com/ViewPost.aspx?PostID=123, but somehow it doesn't work out properly.

I have two files: MasterPage.master with the following header:

<%@ Master Language="C#" ClassName="MasterPage_master" %>

  The reason, why I have not just copied the text from the webpage one-to-one, is that VisualWebDeveloper throws an error caused by the attribut "compilewith".

The source-file of my masterpage is this:

 

public partial class MasterPage_mast : System.Web.UI.MasterPage
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }
    public string Name
    {

        get { return "The Base Master Page"; }

    }
}
 
Secondly, I have my page login.aspx.
 
<%@ Page Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="login.aspx.cs" Inherits="login" Title="Untitled Page" %>
<%@ MasterType virtualPath="MasterPage.master" %>
  
and Code-Page:
 
public partial class login : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        Response.Write(Master.Name());
    }
}
 
I get the error: ASP.MasterPAge_master has no definition for Name.
 
 
I would be glad, if somebody can explain me where the error in this little example is hidden.
 
Thank you very much in advance!
Frank 
johram
Asp.Net User
Re: Communication ContentPage -> MasterPage8/21/2007 10:25:34 PM

0/0

First issue:

<%@ MasterType virtualPath="~/MasterPage.master" %> (be sure to use ~/)

Second issue:

Name is a property of the master page, not a method. Thus, to access it, you should do:

Response.Write(Master.Name);

If this post was useful to you, please mark it as answer. Thank you!
Frank43
Asp.Net User
Re: Communication ContentPage -> MasterPage8/22/2007 7:17:06 AM

0/0

 Hi!

 

Thank you for your answer, but this didn't solve the problem. I've made the changes you suggested, but I still get the same error.

I think, there must be something wrong with the missing "CompileWith"-attribute.

 Thank you!
 

 

johram
Asp.Net User
Re: Communication ContentPage -> MasterPage8/22/2007 9:31:48 AM

0/0

Ah, you need to have a compilewith attribute on the master page. Change the master directive like this:

<%@ Master Language="C#" ClassName="MasterPage_master" CompileWith="MasterPage.master.cs" %> 

Funny though, this should be created automatically for you when you add a new Master page in the studio. Did you create this one by yourself`?
 

 


If this post was useful to you, please mark it as answer. Thank you!
Frank43
Asp.Net User
Re: Communication ContentPage -> MasterPage8/22/2007 12:04:15 PM

0/0

 That is exactly the crucial point, and I am really wondering, why I get the error-message "ASP.NET: Attribute "CompileWith" is not a valid attribute of element "Master".

 

Do you have some ideas?

 The standard-header my Visual WebDeveloper creates for a default MasterPage goes like this:

 

1    <%@ Master Language="C#" AutoEventWireup="true" CodeFile="MasterPage2.master.cs" Inherits="MasterPage2" %>
2    
  

Thank you!

Frank 

Frank43
Asp.Net User
Re: Communication ContentPage -> MasterPage8/22/2007 12:07:49 PM

0/0

Ah I got the error now!

It was a stupid mistake in the MasterPage.master.cs file.

Now it works fine!

 

Thank you very much! 

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


Free Download:

Books:
Beginning ASP.NET 2.0 AJAX: Written and Tested with the Final 1.0 Release Version of ASP.NET AJAX for ASP:NET 2.0 Authors: Wallace B. McClure, Paul Glavich, Scott Cate, Steve C. Orr, Craig Shoemaker, Steven A. Smith, Jim Zimmerman, Pages: 344, Published: 2007
Professional ASP.NET 2.0 Authors: Bill Evjen, Scott Hanselman, Farhan Muhammad, Srinivasa Sivakumar, Devin Rader, Pages: 1253, Published: 2005
Professional ASP.NET 3.5: In C# and VB Authors: Bill Evjen, Scott Hanselman, Devin Rader, Pages: 1673, Published: 2008
Sharepoint 2007: The Definitive Guide Authors: James Pyles, Christopher M. Buechler, Bob Fox, Murray Gordon, Michael Lotter, Jason Medero, Pages: 794, Published: 2007

Web:
Communication ContentPage -> MasterPage - ASP.NET Forums Re: Communication ContentPage -> MasterPage. 08-21-2007, 6:25 PM ... Re: Communication ContentPage -> MasterPage. 08-22-2007, 3:17 AM ...
MSDN Microsoft Unified Communications AJAX SDK Master Page and ... Master Page and content Page Postback Issues. Hi,. I am using a master page , i have 2 content pages let us say content1, content2 . ...
Masterpage communication to content pages? Talk about Masterpage communication to content pages? ... The "slave" as you call it is called "the content page." Use the terms the ...
p2p.wrox.com Forums - Master Page - User Control communication p2p.wrox.com Forums - master page - user control communication. ... How do I change the user control's properties from a content page? Thanks! ...
Master page - Content page - User control communication - ASP.NET ... Master page - Content page - User control communication. Last post 07-07-2008 8: 00 AM by Suprotim Agarwal. 2 replies. Sort Posts: ...
Refreshing content page without refreshing master page - VBForums Refreshing content page without refreshing master page ASP.NET. ... Project Requests, Project Communication Area, Jobs, Just VB Jobs, Open Positions (Jobs) ...
Show and Hide the Div in Content Page of Master Page, ASP.NET ... But it's not working in content Page of Master Page .... Windows Communication Foundation (WCF), Windows Presentation Foundation (WPF), windows CardSpace ...
Lines of Communication Lines of communication are important, especially in programmatic systems. ... Each MasterPage has a reference to the content page that is currently using it ...
p2p.wrox.com Forums - Master Page Method: Code-Behind for Content Page Master Page child controls Initialization. * - Content Page child controls Initialization. .... Internet Information Services, Live Communication Server ...
MultiView Contrtol will not work in content page if master page ... MultiView Contrtol will not work in content page if master page has .... Windows Communication Foundation (WCF), Windows Presentation Foundation (WPF), ...




Search This Site:










htmlcontrols vs webcontrols

skinning on module level. is it possible?

3.0.9 issue - non us and de culture in web.config

can i maintain a .net v1.1 app w/ vs.net 2005?

installing a trial version of visual studio 2005

adding another project/application

is there any way to "highlight" the current page?

display issues with width and 100%

express edition features compared to...

suggestion: put new dnn .zip distribution inside another .zip with a readme!.txt file.

few issues after converting to wap

missing administrative functions/pages?

showing ad of products on the main page.

certificates

how to change text to image in menu?

generate insert,update, delete option does not create an "add" column

dnn 4.1 with sqlexpress installed, all modules on site say, "an error has occurred"

how do you set the tree nodes' fonts and colors???

i am trying to render some html/gif during validatinsummary rendering?

opt in email module by data springs

submit site vs submit tab to google

cannot publish classfieds

your opinion on some hosts in my list please

sql notification services

creating a group object in novell groupwise

help pulling key from database table to update additonal profile information (within createuserwizard)

free tv listing module

strange behaviour with free textbox and 3.0.10 -- content disappears from modules

ddn running after install but no modules work

reportviewer

 
All Times Are GMT