This is a migrated thread and some comments may be shown as answers.

Partial view datasource url for different areas not working as expected

1 Answer 283 Views
This is a migrated thread and some comments may be shown as answers.
Top achievements
Rank 1
Sam asked on 20 Jun 2014, 03:52 AM


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)

        .Items(search =>
                    .Text("Search YLAU EdiLog")
                                <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{
        transport: {
            read: {
                dataType: "json"                  
        dataSource: dataSource,
        dataTextField: "AccountName",


- 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



1 Answer, 1 is accepted

Sort by
Alexander Popov
Telerik team
answered on 24 Jun 2014, 06:03 AM
Hi Sam, 

The slash signifies whether the URL should link to the root path, or to the current one. For example: 
<a href="/test">Test link</a> ===>  localhost/test
<a href="test" >Test link</a> ===>  localhost/Area/Controller/test
It is generally recommended to use the Url helper instead of hard-coded links. For example: 
Url.Action("View", "Controller", new { area="areaName" })

Alexander Popov

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

Asked by
Top achievements
Rank 1
Answers by
Alexander Popov
Telerik team
Share this question