@@ -17,12 +17,13 @@ public static HtmlString RenderDocTypeGridEditorItem(
17
17
IPublishedContent content ,
18
18
string editorAlias = "" ,
19
19
string viewPath = "" ,
20
- string previewViewPath = "" )
20
+ string previewViewPath = "" ,
21
+ bool isPreview = false )
21
22
{
22
23
if ( content == null )
23
24
return new HtmlString ( string . Empty ) ;
24
25
25
- var controllerName = string . Concat ( content . DocumentTypeAlias , " Surface") ;
26
+ var controllerName = $ " { content . DocumentTypeAlias } Surface";
26
27
27
28
if ( string . IsNullOrWhiteSpace ( viewPath ) == false )
28
29
viewPath = viewPath . EnsureEndsWith ( '/' ) ;
@@ -91,21 +92,21 @@ public static HtmlString RenderDocTypeGridEditorItem(
91
92
92
93
// Check for preview view
93
94
if ( string . IsNullOrWhiteSpace ( previewViewPath ) == false
94
- && helper . ViewContext . RequestContext . HttpContext . Request . QueryString [ "dtgePreview" ] == "1" )
95
+ && isPreview )
95
96
{
96
- var fullPreviewViewPath = string . Concat ( previewViewPath , editorAlias , " .cshtml") ;
97
+ var fullPreviewViewPath = $ " { previewViewPath } { editorAlias } .cshtml";
97
98
if ( ViewEngines . Engines . ViewExists ( helper . ViewContext , fullPreviewViewPath , true ) )
98
99
{
99
100
return helper . Partial ( fullPreviewViewPath , content ) ;
100
101
}
101
102
102
- fullPreviewViewPath = string . Concat ( previewViewPath , content . DocumentTypeAlias , " .cshtml") ;
103
+ fullPreviewViewPath = $ " { previewViewPath } { content . DocumentTypeAlias } .cshtml";
103
104
if ( ViewEngines . Engines . ViewExists ( helper . ViewContext , fullPreviewViewPath , true ) )
104
105
{
105
106
return helper . Partial ( fullPreviewViewPath , content ) ;
106
107
}
107
108
108
- fullPreviewViewPath = string . Concat ( previewViewPath , " Default.cshtml") ;
109
+ fullPreviewViewPath = $ " { previewViewPath } Default.cshtml";
109
110
if ( ViewEngines . Engines . ViewExists ( helper . ViewContext , fullPreviewViewPath , true ) )
110
111
{
111
112
return helper . Partial ( fullPreviewViewPath , content ) ;
@@ -115,19 +116,19 @@ public static HtmlString RenderDocTypeGridEditorItem(
115
116
// Check for view path view
116
117
if ( string . IsNullOrWhiteSpace ( viewPath ) == false )
117
118
{
118
- var fullViewPath = string . Concat ( viewPath , editorAlias , " .cshtml") ;
119
+ var fullViewPath = $ " { viewPath } { editorAlias } .cshtml";
119
120
if ( ViewEngines . Engines . ViewExists ( helper . ViewContext , fullViewPath , true ) )
120
121
{
121
122
return helper . Partial ( fullViewPath , content ) ;
122
123
}
123
124
124
- fullViewPath = string . Concat ( viewPath , content . DocumentTypeAlias , " .cshtml") ;
125
+ fullViewPath = $ " { viewPath } { content . DocumentTypeAlias } .cshtml";
125
126
if ( ViewEngines . Engines . ViewExists ( helper . ViewContext , fullViewPath , true ) )
126
127
{
127
128
return helper . Partial ( fullViewPath , content ) ;
128
129
}
129
130
130
- fullViewPath = string . Concat ( viewPath , " Default.cshtml") ;
131
+ fullViewPath = $ " { viewPath } Default.cshtml";
131
132
if ( ViewEngines . Engines . ViewExists ( helper . ViewContext , fullViewPath , true ) )
132
133
{
133
134
return helper . Partial ( fullViewPath , content ) ;
0 commit comments