Developer forum

Forum » Development » Area Name

Reply

Hey, anyone know if i can avoid looking up in the database when i need the area name.

 

i know that i can the area id by

 

PageView.Area.ID

 

but that would mean that  id'd have to look up the id in the dba and get the name out.


Replies

 
Nicolai Høeg Pedersen
Reply
jed@dkis.dk wrote:

Hey, anyone know if i can avoid looking up in the database when i need the area name.

 

i know that i can the area id by

 

PageView.Area.ID

 

but that would mean that  id'd have to look up the id in the dba and get the name out.

You can say PageView.Area.Value("areaname") - You can access these information:
 

Key Value Type
areaactive True System.Boolean
areamainpages System.Collections.ArrayList System.Collections.ArrayList
areaencoding iso-8859-1 System.String
arearobotstxt User-agent: * Disallow: /Files/Filer/SecretFolder System.String
arealanguage Null System.DBNull
areahtmltype xhtml 1.0 System.String
areafirstpage 1 System.Int32
areacodepage 28591 System.Int32
arearobotstxtincludesitemap True System.Boolean
areafirstpagename Forside System.String
styleid Null System.DBNull
areaid 1 System.Int32
areamasterareaid Null System.DBNull
areapermission   System.String
areakeywords Null System.DBNull
areadomain update.local.dynamicweb.dk System.String
areasort 1 System.Int32
areaapprovaltype 0 System.Int32
areapermissiontemplate Null System.DBNull
areadomainlock Null System.DBNull
areadateformat dd-mm-yyyy System.String
areaname Standard System.String
areaculture pt-PT System.String
areamastertemplate XHTML10TransStandard.html System.String
areatitle Some System.String
arealanguagecontrollanguage Null System.DBNull
areaecomcurrencyid Null System.DBNull
areastyleid Null System.DBNull
areafrontpage Null System.DBNull
areaecomlanguageid Null System.DBNull
pagearray System.Collections.ArrayList System.Collections.ArrayList
areadescription Null System.DBNull

 

 
Nicolai Høeg Pedersen
Reply

By the way:

 

You can do something similar with PageView.Page and Pageview.Stylesheet.

 

You can see the possibilities (Key/Value/Type) by writing out:

 

Pageview.OutputPages()

 
Reply
np wrote:

By the way:

 

You can do something similar with PageView.Page and Pageview.Stylesheet.

 

You can see the possibilities (Key/Value/Type) by writing out:

 

 

Pageview.OutputPages()


very nice, thanks nicolai

 
Reply
jed@dkis.dk wrote:
np wrote:

By the way:

 

You can do something similar with PageView.Page and Pageview.Stylesheet.

 

You can see the possibilities (Key/Value/Type) by writing out:

 

 

Pageview.OutputPages()


very nice, thanks nicolai

 

Another way to access these values is via the properties of the Dynamicweb.Core.Area object, example:

 

Dynamicweb.Core.Area area = new Dynamicweb.Core.Area(PageView.AreaID);

Debug.WriteLine("Area ID =" + area.ID);

Debug.WriteLine("Area Name = " + area.Name);

 

Regards,

Emil

 
Nicolai Høeg Pedersen
Reply

True - but that would result in a DB call that is not needed...

 

You must be logged in to post in the forum