Problem:
After enabling Content Security Policy (CSP), Kendo DropDownLists inside a PanelBar fail to initialize. On page load:
• The DropDownList renders as a plain input box.
• PanelBar items appear empty, and data binding does not happen.
• JavaScript access to the DDL fails.
Scenario:
• ASP.NET MVC Razor.
• Dropdown Lists inside PanelBar content templates.
• Worked fine before CSP; now initialization and binding fail.
Expected Behavior:
• DDL should initialize and bind data on content load even with CSP.
• PanelBar items should display properly.
Example:
@(Html.Kendo().PanelBar()
.Name("panelbar")
.ExpandMode(PanelBarExpandMode.Multiple)
.Items(panelbar =>
{
panelbar.Add().Text("Note : Please fill all the input")
.Content(@<text>
@(Html.Kendo().DropDownList()
.Name("dropdown")
.OptionLabel("Please Select")
.OptionLabelTemplate("<span style='color:dimgrey;font-size:10px;font-weight:bold'>Please Select</span>")
.DataValueField("id")
.DataTextField("Text")
.Template("#:id # - #:datacolumn # - #:datecolumn #")
.DataSource(source=>{source.Read(read=>{read.Action("action","controller");});})
.Events(e=>{e.Select("onselect");})
)
</text>
);
Thanks,
Anupriya. R
Note: When commenting the template fileds,
like the below
its working fine. help me on this how to implement these with csp.
Its working fine.