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

Problem with switching views

1 Answer 48 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Trent
Top achievements
Rank 1
Trent asked on 22 Aug 2013, 10:01 PM
Hi all,

I have a question about switching views. It doesn't work the way I'd expect and I'm not sure if I'm structuring my project correctly.

My assumption is that I can switch views by using the controller the way you would usually do in ASP.Net MVC. Here's my code and the URL for the start view:

URL:
http://localhost:2121/Home/MobileHomePage

Code snippet for the button:
@Html.Kendo().MobileButton().Text("Go to new view").Url("ExpenseClaimListMobile", "ExpenseClaim")

When I click the button I'd expect the URL to be:
http://localhost:2121/ExpenseClaim/ExpenseClaimListMobile

Instead it is:
http://localhost:2121/Home/MobileHomePage#/ExpenseClaim/ExpenseClaimListMobile

Is this correct? It seems to work, but when I then navigate back to the home page the URL is:
http://localhost:2121/Home/MobileHomePage#/Home/MobileHomePage
Once we get to this URL the page has problems like the buttons not working, and my assumption is that this is because the application is being created twice (calling "var app = new kendo.mobile.Application();" twice because it's in the _Layout code).

What am I doing wrong?

Thanks in advance!

1 Answer, 1 is accepted

Sort by
0
Kiril Nikolov
Telerik team
answered on 26 Aug 2013, 03:21 PM
Hello Trent,

Initializing the Kendo UI Mobile application twice can cause unpredictable behaviour in your application. So the buttons that are not working and the wrong URL can be caused by the double initialization. Could you please initialize your application just once and then try again to see if it's working correctly?
 
Regards,
Kiril Nikolov
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Tags
General Discussions
Asked by
Trent
Top achievements
Rank 1
Answers by
Kiril Nikolov
Telerik team
Share this question
or