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

Remote views with Razor url structure

4 Answers 71 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
oVan
Top achievements
Rank 2
oVan asked on 13 Jul 2012, 08:12 AM
Hi,

I understand that the default navigation is hash navigation in a single page, and that remote views are pulled in via Ajax.

In Razor WebPages, you can define any seo-friendly url structure just by making sure file exists, and all extra parts of the url are passed in as parameters (eg. mysite.com/products/1/detail -> products.cshtml will accept this and have UrlData[0]="1" & UrlData[1]="detail"). 

I want to keep using this very handy url system combined with the mobile output of Kendo. So, I'm wondering how you handle the common scenario that a visitor browses to a direct url. As you don't include the Kendo styles & scripts in remote views, the visitor will only see unstyled html.

Thanks for any help!
o.

4 Answers, 1 is accepted

Sort by
0
Alexander Valchev
Telerik team
answered on 18 Jul 2012, 08:06 AM
Hello Olivier,

As I understood it you would like to link to external pages (like http://example.com/views/details) instead of working with the build in navigation that uses the view id prefixed with # symbol. To achieve this you should set the data-rel="external" attribute to the respective link element.

<a href="http://kendoui.com/" data-rel="external">Visit KendoUI</a>

I would not recommend using this feature to navigate between the views though, because in this case you would have to include the scripts/styles and initialize a new kendo mobile application in every external view (which will be a performance hit for the mobile device). Navigation to external link is like leaving the mobile application and loading a new web page.

Regards,
Alexander Valchev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
oVan
Top achievements
Rank 2
answered on 18 Jul 2012, 08:24 AM
Hi Alexander,

That is exactly my concern. We're doing the same with jQuery Mobile and I want to avoid that.

But, the client wants to use seo-friendly urls that link to a specific house for sale (http://m.whatever.com/for-sale/55/house-with-2-bedrooms)

How would you approach this with Kendo? Is there a solution with the hash navigation, like http://m.whatever.com/#for-sale/55/house...?

Thank you for your reply! 
0
Alexander Valchev
Telerik team
answered on 19 Jul 2012, 07:22 AM
Hello Olivier,

I am afraid that what you are trying to achieve is not possible - the mobile application do not support other type of navigation between mobile views. A similar type of URL could be achieved only if the requested remote view file is located in nested folders - for example:
//root folder
index.html
    > for-sale
        > 55
            > house.html
 
//the displayed url will have the following format
www.m.site.com/#for-sale/55/house.html


Regards,
Alexander Valchev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
oVan
Top achievements
Rank 2
answered on 21 Jul 2012, 07:10 AM
If I understand your answer correctly, the url after the hash # is loaded by the application. That should make it possible to use Razor WebPages url structure. On the other hand, it should be possible to write a one-line jQuery script to check if the Kendo app is already loaded. That would solve the problem when someone directly navigates to a deep linked page, a redirect would be possible: eg. http://m.mysite.com/products/table/14 -> http://m.mysite.com/#products/table/14 Maybe I'll create a little test to see if it works.
Tags
General Discussions
Asked by
oVan
Top achievements
Rank 2
Answers by
Alexander Valchev
Telerik team
oVan
Top achievements
Rank 2
Share this question
or