• English (United States)
    • العربية (مصر)
    • Deutsch (Deutschland)
    • Español (España, alfabetización internacional)
    • français (France)
    • हिंदी (भारत)
    • italiano (Italia)
    • 日本語 (日本)
    • 한국어 (대한민국)
    • Nederlands (Nederland)
    • polski (Polska)
    • русский (Россия)
    • ไทย (ไทย)
    • Türkçe (Türkiye)
    • Tiếng Việt (Việt Nam)
    • 中文(中华人民共和国)
    • 中文(香港特別行政區)
DotNetAge - Mvc & jQuery CMS
Hide sidebar

Extend your Action


    • Filed under:
    • Developer guide
  • 0

Overview

DotNetAge DynamicUI provides a easy way to extend your Action to be a WebPage. The DynamicUI has a rich set of browser base UI to manage WebPage meta data such as title, description, accessiblity roles, menu visiblity, navigation behaviors and web pages relationship.

There is an easy way to take the advantage of WebPage features functions is specifiy a SiteMapActionAttribute class on your Action method. for example:

We were only specified the SiteMapActionAttribute class on "About" Action method and specified "About me" as web page title.Press F5 to run.

Now as yue see there is nothing happend in our website, because the WebPage is not create yet, login as administrators and access your Action Url mybe like this : http://localhost:portnumber/Example/About/ in following screen short you will found there is a new menu item “Aboue me” add to the main menu.

now i can use the PageManager the edit the meta data of the About Action Page.Select the “SiteTools->EditPage”

Easy piece easy cake!

There are series properties of the SiteMapActionAttibute to controll the WebPage creation in runtime time. For all properties specifation please visist SiteMapActionAttibute members 

How does it work ?

The DynamicUI identifies the current request wheahter current Action is specified SiteMapActionAttibute class and its not exisits in DataBase DynamicUI will create new one.The WebPage creation progress required the administrator idtntity otherwise DynamicUI will not create any WebPage instance and if the WebPage is not exisits a PageNotFound exception will throw.

Shared WebPage

In some case our Action maybe has routeData that will be cause one Action has many different URLs. By default DynamicUI will create WebPage instances for each Url.

For example we define a Action method to show the product information, the code maybe like this:

So we maybe has these Urls to access different products

http://localhost:port/example/product/1

http://localhost:port/example/product/2

http://localhost:port/example/product/3

http://localhost:port/example/product/4

If we wants the DynamicUI just create one webpage for Product we may change our code like this:

We seted the "IsShared" and "IgnoreRouteDataKeys" properties in SiteMapAction

It tells DynamicUI the “Product” Action is a shared Action and ignore all route data named “id”.

 


    Average:
  • Reads
    (644)
  • Permalink
Previous:DotNetAge core layer overview
Share to:

What is newWhat is new

Tag cloud

Anything in here will be replaced on browsers that support the canvas element