Telerik Forums
UI for ASP.NET MVC Forum
0 answers
14 views

Hi,

I have a strict CSP implemented in the Program.cs file, after that when I verified the browser developer tool then I can see the get API is called 2 times.

Can you please let me know why this get API is called 2 times. 

When I analyze I found that Kendo Panelbar Select event is called twice so internally the Get API is called twice.

@(Html.Kendo().PanelBar()
        .Name("panelbar")
        .ExpandMode(PanelBarExpandMode.Multiple)
        .Events(ev => ev.Select("OnSelect_Panel"))
        .Items(panelbar =>
        {
          panelbar.Add().Text("Test Panel");
        })


function OnSelect_Panel(sender) {

}

Inside the OnSelect_Panel() method is calling twice so the GET API also called twice. How can I restrict to one API call.

Note: Without strict CSP OnSelect_Panel() is called once but with strict CSP it called twice.

 

abdul
Top achievements
Rank 2
Iron
Iron
 updated question on 19 Sep 2025
1 answer
22 views

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

Anton Mironov
Telerik team
 answered on 09 Sep 2025
1 answer
92 views

Hi,

We are using Kendo controls for MVC. There was a security scan done in our application, it capture few of the security issues.

We are able to fix all of the security issues except one.

CWE 829 - The application contains unsafe Content-Security-Policy (CSP) directives that could allow malicious script code to be included on the page.

So, as a result we have removed all the custom inline javascript and css to an external files and refer those external .js and .css files in our .cshtml page.

But when we use any of the Kendo controls like Kendo grid or Kendo calendar then in the runtime it create some inline scripts and we are getting application contains unsafe Content-Security-Policy (CSP) directives.

How to bypass those runtime inline scripts created by Kendo controls so that we don't get unsafe Content-Security-Policy (CSP) directives

during the security scan of the application.

Please let me know if you need any more information on this.

1 answer
121 views

I have a div  tag which has all three controls within the tag

1. TabStrip as the main container

2. Panel bar inside the tab

3.Dropdown inside the panel bar.

But the code is giving me the error - Inline markup blocks (@<p>Content</p>) cannot be nested.  Only one level of inline markup is allowed.

Can somebody help me to resolve  and  fix it.

Below is my code structure

        <div class="InputArea">
            @(Html.Kendo().TabStrip()
                    .Name("ScenaioNMDTabStrip")
                    .TabPosition(TabStripTabPosition.Top)
                    .Items(tabstrip =>
                    {
                     tabstrip.Add().Text("NMD")
                    .Selected(true)
                    .HtmlAttributes(new { style = "height: 55px;width: 20%;" })
                    .Content(@<text>
                    <div class="col-lg-11" style="float:left;">
                    </div>
                @(Html.Kendo().PanelBar()
                .Name("panelbar1")
                .HtmlAttributes(new { style = "width:200px;" })
                .Items(panelbar=>{
                panelbar.Add().Text("Scenario NMD")
                .Content(@<text>
                    @(Html.Kendo().DropDownList()
                    .Name("EmpyreanVersion")
                    .DataTextField("VersionId")
                    .DataValueField("VersionId")
                    .HtmlAttributes(new { style = "width: 150px;" })
                    )
                </text>);
                })
                
                )
            </text>);
              tabstrip.Add().Text("Empyrean");
                    })
                )
        </div>

Anton Mironov
Telerik team
 answered on 10 Mar 2025
1 answer
147 views

Hi,

I have a Kendo Menu with the menu items, when user will click on the menu it should show the Kendo panels vertically and then again click on the menu should hide the panels within that menu. On Click on the Panelbar items should show the respective pages.

Attached is the screenshot for the reference.

Eyup
Telerik team
 answered on 19 Nov 2024
1 answer
73 views

 

I have PanelBar called  Interest Rates and 3 children. I want the parent and all the 3 children cursor to  pointer when hover the mouse.

Interest Rates

Default Rates

Negative Carry

Cash FTP

 

Thanks,

Abdul Ashad

Eyup
Telerik team
 answered on 17 Sep 2024
1 answer
75 views

How to make the Kendo Panel Bar children as right indented.

 

For example I have PanelBar called  Interest Rates and 3 children. I want the 3 children as below right indented.

 

Interest Rates

Default Rates

Negative Carry

Cash FTP

 

Thanks

Abdul Ashad

 

 

Tsvetomila
Telerik team
 answered on 12 Sep 2024
1 answer
146 views

I have tried to implement Kendo Panel Bar as an accordion in the project, but expand collapse is not working in the panel bar. It is showing the below error in the console,

Attached the source code

Mihaela
Telerik team
 answered on 28 May 2024
2 answers
196 views

I am  using the PanelBar with Items Binding. I am LoadingContent on the Expansion of a Panel.  I would like to "refresh" or re load the content after a panel has been expanded, collapsed and then re-expanded.  Currently, the panel does not re-load the content.

 

Is there a way to force the panel to be re-loaded?

Antonio
Top achievements
Rank 1
Iron
 answered on 17 Nov 2023
1 answer
206 views

Hi,

I first tried using a loop creating expansion panels which works fine on the face of it but each expansion panel needs to have a Rich Text Editor inside of it and it was not allowing me to click into the editor so I read it may be better to use a PanelBar to achieve what i need.

Basically what I need it to loop through a collection within the ViewModel and create a Panel Bar Item for each one. Each Panel Bar Item will generate 3 Rich Text Editors with Labels.

The markup shows no errors but when running I get "System.ArgumentOutOfRangeException: 'Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index'". This happens with even a single control referencing the index of the for loop e.g.:

An example of the code is:

@(Html.Kendo().PanelBar()
                    .Name("panelbar")
                    .ExpandMode(PanelBarExpandMode.Multiple)
                    .Items(panelbar =>
                    {

                        for (int i = 0; i < Model.SomeCollection.Count; i++)
                        {
                            panelbar.Add().Text(Model.SomeCollection[i].SectionHeading)
                                .Expanded(false)
                                .Selected(false)
                                .Content(@<text>
                                             
                                @Html.HiddenFor(model => model.SomeCollection[i].SectionUid)

                          </text>);
                        }
                    }))

 

If I don't reference the i of the for loop within the content it works fine e.g.:

 

@(Html.Kendo().PanelBar()
                    .Name("panelbar")
                    .ExpandMode(PanelBarExpandMode.Multiple)
                    .Items(panelbar =>
                    {

                        for (int i = 0; i < Model.SomeCollection.Count; i++)
                        {
                            panelbar.Add().Text(Model.SomeCollection[i].SectionHeading)
                                .Expanded(false)
                                .Selected(false)
                                .Content(@<text>
                                
                                             <div>Some Text</div>

 

                          </text>);
                        }
                    }))

 

The reason I am using a 'for i =' loop instead of a foreach loop is because the collection was not being returned to the controller on post when I used a foreach loop but this method worked which could be down to my inexperience with MVC but I went with what worked.

The Expansion Panels worked great other than not being able to click into the Kendo().Editor() controls at all when they were inside the for loop. If I bound them to a control outside of the loop then they worked fine.

Any help would be greatly appreciated.

 

 

Vasko
Telerik team
 answered on 21 Jul 2023
Narrow your results
Selected tags
Tags
Grid
General Discussions
Scheduler
DropDownList
Chart
Editor
TreeView
DatePicker
Upload
ComboBox
MultiSelect
ListView
Window
TabStrip
Menu
Installer and VS Extensions
Spreadsheet
AutoComplete
TreeList
Gantt
NumericTextBox
Filter
ToolTip
Map
Diagram
Button
PivotGrid
Form
ListBox
Splitter
Application
FileManager
Sortable
Calendar
View
MaskedTextBox
PDFViewer
TextBox
Toolbar
MultiColumnComboBox
Dialog
DropDownTree
Checkbox
Slider
Switch
Notification
ListView (Mobile)
Pager
Accessibility
ColorPicker
DateRangePicker
Wizard
Security
Styling
Chat
MediaPlayer
TileLayout
DateInput
Drawer
SplitView
Barcode
ButtonGroup (Mobile)
Drawer (Mobile)
ImageEditor
RadioGroup
Sparkline
Stepper
TabStrip (Mobile)
GridLayout
Template
Badge
LinearGauge
ModalView
ResponsivePanel
TextArea
Breadcrumb
ExpansionPanel
Rating
ScrollView
ButtonGroup
CheckBoxGroup
NavBar
ProgressBar
QRCode
RadioButton
Scroller
Timeline
TreeMap
TaskBoard
OrgChart
Captcha
ActionSheet
Signature
DateTimePicker
AppBar
BottomNavigation
Card
FloatingActionButton
Licensing
Localization
MultiViewCalendar
PopOver (Mobile)
Ripple
ScrollView (Mobile)
Switch (Mobile)
PivotGridV2
FlatColorPicker
ColorPalette
DropDownButton
AIPrompt
PropertyGrid
ActionSheet (Mobile)
BulletGraph
Button (Mobile)
Collapsible
Loader
CircularGauge
SkeletonContainer
Popover
HeatMap
Avatar
ColorGradient
CircularProgressBar
SplitButton
StackLayout
TimeDurationPicker
Chip
ChipList
DockManager
ToggleButton
Sankey
OTPInput
ChartWizard
SpeechToTextButton
InlineAIPrompt
TimePicker
StockChart
RadialGauge
ContextMenu
ArcGauge
AICodingAssistant
+? more
Top users last month
Ambisoft
Top achievements
Rank 2
Iron
Pascal
Top achievements
Rank 2
Iron
Matthew
Top achievements
Rank 1
Sergii
Top achievements
Rank 1
Iron
Iron
Andrey
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Ambisoft
Top achievements
Rank 2
Iron
Pascal
Top achievements
Rank 2
Iron
Matthew
Top achievements
Rank 1
Sergii
Top achievements
Rank 1
Iron
Iron
Andrey
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?