Scenario:
I have a kendo ui panel bar in a view within an area(say MyArea) which has kendoComboBox (partial view) from a different area(say Services)
@(Html.Kendo().PanelBar()
.Name("PanelBar")
.Items(search =>
{
search.Add()
.Text("Search YLAU EdiLog")
.Expanded(true)
.Content(@<text>
<form method="post" id="myForm">
<div class="TableCell">@Html.Partial("~/Services/Views/Customer/WMSCustomerList.cshtml") </div>
WMSCustomerList.cshtml(partial view):
<script type="text/javascript">
var dataSource = new kendo.data.DataSource({
transport: {
read: {
url:"Services/Customer/WMSCustomerList",
dataType: "json"
}
}
});
$("#Company").kendoComboBox({
dataSource: dataSource,
dataTextField: "AccountName",
dataValueField:"AccountCode"
})
Issues:
- The url specified for the kendo combo box does not gets called i.e, the controller from a different area(Services) does not get called.
Q: How do you call a datasource from different areas in a partial view ?
- I changes the datasource url by adding a slash in the start of the url (url:"/Services/Customer/WMSCustomerList",) which then works correctly.
Q: What is the significance of adding a slash in front of the url? Why doesn't the url area switching work without a slash? Please clarify
Thanks!