Hi Muhammad,

First, make sure that you have controller-actions for your views.

Next, make sure that the views load without using Angular.  So if you have
a controller-action for */tpl/app_dashboard*, and it returns one of your
cshtml views, try loading opening something like
*http://localhost/tpl/app_dashboard
<http://localhost/tpl/app_dashboard>* in your web browser.  Before moving
on to the Angular side, you must be sure this is working.

Once that is working, change your the template URL in your route setup to
*tpl/app_dashboard*.  Do not put "html" on the end of it.

Good luck!
SS

On Thu, Sep 11, 2014 at 8:17 AM, Muhammad Faizan <
[email protected]> wrote:

> I am working on MVC 5 project. When I use html page it load that page but
> when I use .cshtml page it is not loading, the blank page appears.
>
> $urlRouterProvider
>             .otherwise('/app/dashboard');
>         $stateProvider
>             .state('app', {
>                 abstract: true,
>                 url: '/app',
>                 templateUrl: 'tpl/app.html'
>             })
>             .state('app.dashboard', {
>                 url: '/dashboard',
>                 templateUrl: 'tpl/app_dashboard.html'
>             })
>
>
> if I used .cshtml file instead of html. It shows blank page. is there any
> way to call my .cshtml pages instead of html pages? Thanks.
>
>
> On Friday, May 23, 2014 8:22:07 PM UTC+5, steven smock wrote:
>>
>> What happens?  Does it fail to load anything at all?  Are there any
>> errors thrown?
>>
>> As I understand it, .cshtml with Razor will only help you when it is
>> called via an MVC GET action that returns it as a "rendered" view.
>>
>> Can you try specifying the URL of the action instead, i.e.
>> /MyController/MyView, instead of /Views/MyController/MyView.cshtml?
>>
>> On Friday, May 23, 2014 1:54:21 AM UTC-4, Sombir Verma wrote:
>>>
>>>
>>>   Is angular routing template url support for .cshtml file in ASP.Net
>>> MVC 4 Project ?
>>>
>>>    if yes then please guide. because when I use html page or .aspx page
>>> it load that page but when I use .cshtml page it is not loading the view.
>>>
>>>    Thanks in advance :)
>>>
>>  --
> You received this message because you are subscribed to a topic in the
> Google Groups "AngularJS" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/angular/pzjrfKVsV_0/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> [email protected].
> To post to this group, send email to [email protected].
> Visit this group at http://groups.google.com/group/angular.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.

Reply via email to