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: 10/21/2005 2:21:57 AM Date Modified: Subscribers: 0 Subscribe Alert
Rate It:
(NR, 0)
XPoints: N/A Replies: 4 Views: 17 Favorited: 0 Favorite
Can Reply:  No Members Can Edit: No Online: Yes
5 Items, 1 Pages 1 |< << Go >> >|
dabbi2005
Asp.Net User
A custom Page attribute, defined at top level10/21/2005 2:21:57 AM

0/0

Is there any custom attribute (property) I can set at the @Page declaration syntax for the Master page to read and parse?

The Masterpage renders a particular image for every page but I want to be able to set a custom image or just disable it easily in some specific pages and so the Masterpage code-behind would read that particular attribute value and set the image properties accordingly...

dannychen
Asp.Net User
Re: A custom Page attribute, defined at top level10/21/2005 3:12:23 PM

0/0

Yes.  If you have a baseclass that you inherit, you can put properties in there that can be specified on the directive.  This does not work for properties in the CodeBehind classes or declared on the page although the CodeBehind class can inherit from this baseclass.  This work on the same for Pages but I'll show MasterPages since you requested it.  Example:


App_Code/BaseClass.vb:

Public Class BaseClass
  Inherits MasterPage

  Public Property Test() As String
   ...
  End Property

End Class

Single File Master Page:
<%@ Master Language="VB" Inherits="BaseClass" Test="This is some text" %>

CodeBehind MasterPage:
<%@ Master Language="VB" CodeFile="master.master.vb" CodeFileBaseClass="BaseClass" Inherits="Master" Test="This is some text" %>

master.master.vb:

Public Class Master
  Inherits BaseClass
End Class

Let me know if this is what you want!
--
Danny


disclaimer: Information provided is 'as is' and conveys no warranties or guarantees.
dabbi2005
Asp.Net User
Re: A custom Page attribute, defined at top level10/21/2005 9:13:01 PM

0/0

thx very much altough I still haven't got it working. Actually I'm using C# and the attribute I want to add is to the Page control so I've tried:

In App_Code/BaseClass.cs I put:

public class BaseClass : System.Web.UI.Page
{
   public string DecorationImage;
}



In Default.aspx codebehind I put:
public partial class _Default : System.Web.UI.Page
{ ... }


And so set for the same Default.aspx page:
<%@ Page Language="C#" MasterPageFile="~/masterpage.master" CodeFile="Default.aspx.cs" Inherits="_Default" DecorationImage="roses" %>


Well this stops me already at compilation level, VS says there is no such attribute defined!

dannychen
Asp.Net User
Re: A custom Page attribute, defined at top level10/24/2005 4:10:25 PM

0/0

 dabbi2005 wrote:



In Default.aspx codebehind I put:
public partial class _Default : System.Web.UI.Page
{ ... }


And so set for the same Default.aspx page:
<%@ Page Language="C#" MasterPageFile="~/masterpage.master" CodeFile="Default.aspx.cs" Inherits="_Default" DecorationImage="roses" %>


Well this stops me already at compilation level, VS says there is no such attribute defined!



This is where you strayed from my example. 

First:  You need to inherits from the baseclass:

public partial class _Default : BaseClass

Second: You need to specify a CodeFileBaseClass attribute on your page directive:

<%@ Page .... CodeFileBaseClass="BaseClass" %>

--
Danny
disclaimer: Information provided is 'as is' and conveys no warranties or guarantees.
dabbi2005
Asp.Net User
Re: A custom Page attribute, defined at top level10/24/2005 10:24:03 PM

0/0

sorry was a little too fast to panic there, it's fixed and it's working. I actually found some code where ScottGu describes the whole process by implementing a custom Page class. It surprised me in the comment section so few saw the potentials of this... In my case it's a great feature I've been trying to code for weeks! I can now change the image source for a "decoration image" in the masterpage from just one single Page attribute instead of 2-3 lines of code within each and every Page_Load section of the content pages. I love it!!
5 Items, 1 Pages 1 |< << Go >> >|


Free Download:

Books:
SMIL 2.0: Interactive Multimedia for Web and Mobile Devices Authors: Dick C. A. Bulterman, Lloyd Rutledge, Pages: 439, Published: 2004
Web Technologies: A Computer Science Perspective Authors: Jeffrey C. Jackson, Pages: 574, Published: 2007
Pro PHP XML and Web Services Authors: Robert Richards, Pages: 919, Published: 2006
ASP.NET AJAX Programming Tricks Authors: Matthew David Ellis, Matthew Ellis, Pages: 388, Published: 2007
Applied Microsoft Analysis Services 2005: And Microsoft Business Intelligence Platform Authors: Teo Lachev, Pages: 712, Published: 2005
Python in a Nutshell: A Desktop Quick Reference Authors: Alex Martelli, Pages: 654, Published: 2003
Office 2003 XML: Integrating Office with the Rest of the World Authors: Evan Lenz, Simon St. Laurent, Mary McRae, Pages: 576, Published: 2004
Professional C# 2005 with .NET 3.0 Authors: Christian Nagel, Bill Evjen, Jay Glynn, Karli Watson, Morgan Skinner, Pages: 1748, Published: 2007
The Common Language Infrastructure Annotated Standard Authors: James S. Miller, Susann Ragsdale, Pages: 891, Published: 2004
PPDP '04: Proceedings of the 6th ACM SIGPLAN International Conference on Principles and Practice of Declarative Programming, August 24-26, 2004, Verona, Italy Authors: Eugenio Moggi, David S. Warren, ACM Special Interest Group on Programming Languages, Association for Computing Machin, ACM Digital Library, Pages: 250, Published: 2004

Web:
A custom Page attribute, defined at top level - ASP.NET Forums Re: A custom Page attribute, defined at top level. 10-21-2005, 11:12 AM. Contact ... Re: A custom Page attribute, defined at top level ...
Creating Custom Attributes Now that the attribute is created, it must be associated with it’s. dependents. From the Manage Custom Attributes screen, select the desired. top level ...
The toplevel system (ocaml) Toplevel phrases can refer to identifiers defined in compilation units with the same mechanisms as for ... 9.5 Building custom toplevel systems: ocamlmktop ...
Create Attribute Click the Navigator link, then click the Page Groups tab. At the top level, click the link for the page group in which you want to create the attribute. ...
Macromedia - JRun LiveDocs : Strategies for working with the JMC ... A service underneath a top-level service. JRunTransactionService. ... When you specify a service attribute in a JMC custom tag, you can also specify a ...
Global Attributes in Visual Basic You add global attributes in source code after any top-level directives, ... The following table shows the informational attributes defined in the System. ...
O'Reilly - Safari Books Online - 0596001169 - ASP.NET in a Nutshell This class name appears as the top-level object in the Control Tree when ASP. ... Use of this attribute substitutes the user agent string defined in the ...
Edit Item Type: Attributes To set the default value of a custom Project ID attribute to the current project ... At the top level, click the link for the page group that owns the item ...
Accessibility Programming Guidelines for Carbon: Create ... To create an HIObject (or HIView) wrapper for a custom user interface object, ... To follow the Carbon convention, the identifier of the top-level object ...
CDI Corporate Education Services - Index of HTML Toplevel Tags HTML Toplevel Tags. This document describes tags that affect an entire web page or, .... If the attribute URL is specified the browser will load the page ...

Videos:
Developing JavaScript with Chickenfoot Google TechTalks July 25, 2006 Rob Miller Michael Bolin ABSTRACT Chickenfoot is a Firefox extension that embeds a JavaScript programming environmen...
www.moldytoaster.com nd; about two feet of snow had fallen, the drifts were deep, and all trace of the path obliterated. The minimum thermometer had fallen to 3.7 degrees...
A Googly MySQL Cluster Talk Google TechTalks April 28, 2006 Stewart Smith Stewart Smith works for MySQL AB as a software engineer working on MySQL Cluster. He is an active memb...
Social Distortion (Zach V) www.myspace.com/DVLH Social Distortion (sometimes referred to simply as Social D) is an American punk rock band formed in 1978 in Orange County, Cali...
Zeitgeist 2 : Addendum - Subtitles English / French Zeitgeist: Addendum, by Peter Joseph 2008 English Subtitles ! French See ya later on thezeitgeistmovement.com You can Download Srt file here : EN:...
www.moldytoaster.com ow where perpetual snow descends to the path, an ugly carved head of a demon, with blood-stained cheeks and goggle-eyes, was placed in a niche of roc...




Search This Site:










dnn challenge

microsoft visual web developer express 2005 installation

master page user.identity.name problem

parser error: could not load type 'login' - vwd2008 issue

webpart for text changes in a simple cms

how to set number of webparts allowed in a webpart zone

logged in username in a module?

dynamic master page

sql server does not exist or access denied

no "select master page" on new item dialog

dotnetnuke and the web server in visual web developer express

loginview and findcontrol

file.exists cannot find files in different server

remembered but not yet authenticated

dumb question of the day

user management

problem in display page in internet explorer using vs 2005 asp.net development server

'unable to cast object of type' error

content place holder help plz?

dotnetnuke.webutility dependency error

switching image on database value

issue tracker starter kit.

skin not showing when logged in as admin/host

dual photos in the details.aspx page...

deleting a tab record...

impersonate

multiple sites

two questions about ibs store programming methods

need advice on making my app look "pretty"

how to create virtual folder in iis for asp.net 2005 web project

 
All Times Are GMT