Inhalte aufrufen

Profilbild

Where in smartStore.net are multiple (partial) views in same view

MVC Models Views Controllers

  • Bitte melden Sie sich an, um eine Antwort zu verfassen.
1 Antwort zu diesem Thema

#1 net4u

net4u

    Advanced Member

  • Members
  • 48 Beiträge

Geschrieben: 24 April 2015 - 11:16

Hi,

Where in smartStore.net I can found this kind of scenario: multiple partial views rendered in same view, each partial view pulling data from his own model and models not related between (not a master detail relation but totally independent tables)?

In my real life scenario (not necessarily related to smartStore.net) I want to render in main View (Home) partial views that display for examples latest records from two different tables and/or also the total number of records for those two different tables (something like a dashboard)

And also for entering data a kind of form that finally with only one click submit data in a master table with one ore more child table and for the given master table, may allow more than one records in child(s) table (something similar with registering a user in Users table and adding more different addresses in UserAddresses table, eventually other information in other child tables; something similar with a wizard like form)

Any help will be appreciated.

Thank you

#2 Marcus Gesing

Marcus Gesing

    SmartStore AG

  • Administrators
  • 3652 Beiträge

Geschrieben: 24 April 2015 - 12:33

See \SmartStore.Web\Views\Catalog\CategoryTemplate.ProductsInGridOrLines.cshtml.
Alternative: \SmartStore.Web\Administration\Views\Home\Index.cshtml illustrates child actions.
 
"And also for entering data a kind of form that finally with only one click submit data in a master table with one ore more child table..."
Proper model binding would be useful here. \SmartStore.Web\Administration\Models\Plugins\LicensePluginModel.cs and 
\SmartStore.Web\Administration\Views\Plugin\LicensePlugin.cshtml could give you a hint.

Schöne Grüße aus Düsseldorf,
Marcus Gesing



Auch markiert mit einem oder mehrerer dieser Schlüsselwörter: MVC, Models, Views, Controllers