Search code examples
c#asp.net-mvc-4razorxamarin.androidhybrid-mobile-app

Redirect from one Razor View to another Razor View


I am new to Razor Views and I am working on Xamarin studio, making a hybrid application that works only on WebView.

Long story short, I am not working with MVC. No models and no controllers here, only Razor Views. Now this might be a wrong question, but is it possible to navigate from one razor view to another??

Like, from one .cshtml to another .cshtml, without going through any Controller, because I don't have Controllers.

Any .NET helper like, @Html.ActionLink("Text", "someFolder/page2.cshtml");

Update 1

Screenshots of index.cshtml and MainActivity.cs, from which I am generating HTML for index:

enter image description here

enter image description here

The breakpoint is on the line that is generating the HTML.


Solution

  • No you cannot redirect to another view without calling action.

    In asp.net mvc you have actions and against actions View is returned, we can show two views in a view without calling action but cannot redirect to some view without calling action.

    If you don't need controllers then you are not following mvc architecture so then i would prefer to use simple html pages, there is no need to use mvc in this case.