Partial view datasource url for different areas not working as expected

2 posts, 0 answers
  1. Sam
    Sam avatar
    1 posts
    Member since:
    Oct 2013

    Posted 19 Jun 2014 Link to this post


    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



  2. Alexander Popov
    Alexander Popov avatar
    1437 posts

    Posted 24 Jun 2014 Link to this post

    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.

Back to Top