You are on page 1of 10

MVC

Paging

PagedList

IPagedList

@Html.PagedList(Model, page => Url.Action("ActionName", new {page}),

PagedListRenderOptions.Minimal)

Partial Views

@Html.Partial("ViewName", Model_If_Any)

Child Action

ChildActionOnly

o

Tag on Controller’s Action

@Html.Action("ActionName")

o

In View

Caching

OutputCache(Duration="sec") ChildAction Caching

Output Cache Settings

VaryByParam()

o

"*" - To Cache every parameter

o

"none" - Always cache the same content

o

"name" - To cache every name parameter

Location

o

Cache on client or server or client & server

Cache Profile

<caching> <outputCacheProfiles> <add name="Profile1" duration="10"

/>

</outputCacheProfiles>

</caching>

Localization

<globalization culture="auto" uiculture="auto" />

Resource Files

Resource Files

Custom Error Message ErrorMessageResourceType=typeof(ClassNam e), ResourceName="Message"