Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Using Bootstrap CSS in ASP.NET web forms
Message
De
14/06/2013 13:25:02
 
 
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Versions des environnements
Environment:
VB 9.0
OS:
Windows Server 2012
Network:
Windows 2008 Server
Database:
MS SQL Server
Application:
Web
Divers
Thread ID:
01576247
Message ID:
01576448
Vues:
23
>>>>>>>You can't see it directly in a browser. You need to run the app.
>>>>>>
>>>>>>'View in Page Inspector' ?
>>>>>>
>>>>>
>>>>>I think Craig has a point. I created an ASP.NET MVC Empty Application, added an HTML page to the View. The HTML Page is almost empty. When I try to View the page in Page Inspector I get error "Server Error in '/' Application. The resource cannot be found. HTTP 404".
>>>>>So the Page Inspector is not very helpful.
>>>>
>>>>Did you wire up the View to a controller ?
>>>
>>>No I did not. And I am reading all your, Craig's, and Mike's messages trying to understand what and how to do it. Thank you.
>>
>>Somewhere back there, in a post to Craig, I showed the steps I took. Seems like the Page Inspector is smart enough to associate the View with the relevant controller action (i.e. if the Controller is not there to instantiate the View it won't work)....
>
>I will track down your message to Craig. Another thing that I could be missing is the name of the HTML. Somewhere I remember reading (or seeing in a training) that each view has to have a "specific" name. Maybe starting with the word "View"?

If you don't specifically specify the View in the Controller it will look for a View with the same name as the method. e.g. Controller:
public ActionResult Login()
        {
            return View();
        }
will look for a view named Login.cshtml (assuming razor) in the Views/{controllerName} folder.
If you create the method in the controller then right-click in the method and choose 'Add View' it will create the view in the right place for you....
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform