Inhalte aufrufen

Profilbild

how to add new controller and view

seite ausrichtung

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

#1 arifin.wm

arifin.wm

    Advanced Member

  • Members
  • PunktPunktPunkt
  • 33 Beiträge

Geschrieben: 30 August 2016 - 08:23

Dear All,

 

I've created new table and would like to launch it in an administrator setting.

I've tried to create new controller, but I got this error 

 

---------------------------
Microsoft Visual Studio
---------------------------
Error
 
There was an error running the selected code generator:
 
'Cannot create an abstract class.'
---------------------------
OK   
---------------------------
 
Is there any example of how to create new view on it ?
 
I also would like to modify the Country View, but I can't find it, where's the country view ?
 
Thanks
 
Best Regards,
Afin


#2 Murat Cakir

Murat Cakir

    SmartStore AG

  • Administrators
  • 1118 Beiträge

Geschrieben: 30 August 2016 - 19:08

Obviously you tried to create a new controller with Visual Studio scaffolding tools. Honestly, I've never tried scaffolding in SmartStore.NET and would not advise to do so. Just create an empty controller wich inherits from AdminControllerBase or SmartController (or just Controller if you don't need all the sugarand add your desired action methods.

 

I also advise to encapsulate your customizations in a separate plugin. Please have a look at GoogleMerchantCenter or ShippingByWeight plugin. These plugins contain the whole stack you need: new entity, new data context, controller, views etc.

 

You can modify the country view in in SmartStore.Admin/Views/Country/_CreateOrUpdate.cshtml.


Murat Cakir
SmartStore AG


#3 arifin.wm

arifin.wm

    Advanced Member

  • Members
  • PunktPunktPunkt
  • 33 Beiträge

Geschrieben: 31 August 2016 - 03:25

Hi Murat,

 

Thanks for your advise :)

 

Best Regards,

Afin