Design View for ASP.NET MVC3 Views - asp.net-mvc-3

Is there a Design View in ASP.NET MVC3 ?

There is no 'Design' view in MVC, like there is in Forms. However your views are just HTML so you can use any HTML editor, although they will not be able to interpret the Razor syntax.
What most people do is make changes to the HTML, save (you don't have to recompile,) and refresh your browser. Google Chrome has a very help full tool built in (Firebug or something like it.) Just right click on the page and select Inspect Element. This will come in very handy.
Also one thing to think about since you're new to MVC is that you can easily use most any css themes that you can find online to make the site look very different out of the box.

Related

Issues using Dreamweaver Design view while editing a site that contains Smarty

I setup a new site on dreamweaver and imported my site files in. I only did this since I wanted to play around with the design view, otherwise I just use notepad++. Anyways When I go into design view I can see the text of all my smarty tags and I don't see the design of the website. Is there a way to make the design view work properly so that my smarty code isn't shown as text and my website is shown correctly. Any nudges in the right direction would be greatly appreciated! If this isn't possible should I just stick with editing my code in notepad++ or is dreamweaver better?
You can switch to Live View. Live view differs from the traditional Dreamweaver design view in that it provides a non-editable, more realistic rendering of what your page will look like in a browser.
When you switch to Live view from Design view, you are simply toggling the Design view between editable and “live”.
While Design view remains frozen once you enter Live view, Code view remains editable, so you can change your code, and then refresh Live view to see your changes take effect. When you’re in Live view, you have the additional option of viewing live code. Live Code view is like Live view in that it displays a version of the code that the browser is executing in order to render the page. Like Live view, Live Code view is a non-editable view.
An additional advantage of Live view is the ability to freeze JavaScript. You can refer to the following Wiki to know more: http://help.adobe.com/en_US/dreamweaver/cs/using/WS753df6af718a350a-43cf1449133aea5253f-8000.html#WS16D4BD4B-0A17-44b9-95E9-ACC9795CE4F9
Regards,
Yalpi Shiva Prasad
Adobe Systems Incorporated.

_Layout.cshtml in MVC3 with Razor has view mode?

I need some help!
I try to design my master page by _Layout.html with Razor. But I can see it as review cause there's no View mode in Visual Studio. I just want to know: Does _Layout.cshtml in MVC3 has view mode, source mode and split mode like masterpage (*.Master) ? If yes, how can I use it?
Thanks all!
No, there is currently no WYSIWYG editor in Visual Studio for ASP.NET MVC view designing.
But there is a brighter side to that answer. Use FireFox and a plug-in called Firebug. Firebug is possibly one of the greatest tools that a web developer can have. It not only lets you see everything from markup to Ajax requests, but it also allows you to do real-time editing/modifying of HTML and CSS.
Firebug

MVC Razor GUI and Coder Working Together

I would really like to use the MVC and Razor technology for my web application. The problem I am running into is that I am the coder and will be working with a HTML GUI designer.
I only see 2 ways for the GUI person to work at this point.
Install Visual Studio and open the whole solution and work like I am working, except he would stick to the CSHTML files.
Use his favorite HTML editor or notepad and edit the CSHTML files manually and then also have something like IIS Express installed with the app configured so that they can refresh the page they are working on.
Neither of these seems productive or intuitive. I would love to see the GUI person able to use a tool like Expression Web or other tools that allow you to see the design and html at the same time. Having tools available for shading and colors and positioning would be good.
Now I understand why it is this way. It is because of the processing that Razor does to render the pages. This is most true by the fact that most of the cshtml pages themselves are not complete pages. They are meant to live inside of a _layout page.
Isn't there something, though, that can at least show the basic rendering during editor?
What are other people doing?
You have a few options. AFAIK there is no WYSIWYG HTML editor that understands Razor. So, either your designer must work in straight html, or...
1) The designer works in pure HTML files. They give you those files, and you adapt them to Razor. If they need to make changes, you can track those changes with a diff tool (from the previous version) or use a version control system to compare versions of the raw html. Then you apply those changes to your Razor files.
2) Your designer works in .aspx files, which Expression Web understands. You could convert the WebForm syntax to Razor syntax. Again, you are spent doing lot of work, but probably less work than the pure HTML way of doing things, because the designer will have designed the code for master pages. These can be relatively easily adapted to Layouts.
It would be nice if the next version of Expression understands Razor.

TabContiner with razor

I have a question. Is it possible to work with AJAX Control Toolkit in razor views?
I need to use TabContainer or similar (it could be a HTML Helper)
I know I can use it in aspx but I'm using Layouts on my project... so maybe a partial view is the solution, I really don't know.
Regards.
I have a question. Is it possible to work with AJAX Control Toolkit in razor views?
Not recommended. The AJAX Control Toolkit consists of server side controls which depend on ViewState and PostBack which are notions that no longer exist in ASP.NET MVC. So referencing the AjaxControlToolkit assembly inside an ASP.NET MVC application is like attaching a caravan on a Lamborghini.
As an alternative you might take a look at jQuery UI which has many useful widgets such as Tabs.

ASP.NET MVC 3 : Design choice for view engine

I'm going to create a website with lots of business logic, connected to a background data model. For these reasons I chose ASP.NET MVC3 as development platform.
Unfortunately, I left web programming at the time of the old ASP and JSP and lately I worked with windows applications and C#.
Now I'm wondering which is the best(easiest, fastest, most reliable, most compatible with browsers) technique to create user views?
I explored a little Razor, but it is unclear for me, is it a so good choice? Is it supported by forums or still too fresh?
I'm very tempted of using webcontrols since I'm now addicted to them. Would this be a good choice? Can I use webcontrols just in aspx or in razor as well?
What about Ajax controls? Would it be a better choice?
Thanks!
Yes, Razor is a good choice. See here for a pretty good summary.
As Robert mentioned, "controls" go against the MVC pattern and will not even work in Razor. You want html helpers for small bits of markup (for example, to render a text box) and partial views for more complicated things (like a shopping cart widget)
Use of AJAX depends on the UI needs of your application. Initially it would be simpler to start without AJAX. Also, some clients might have JavaScript disabled and then AJAX would not work.
"web controls" are not appropriate for MVC at all - they go against the MVC pattern. Instead, look into "partial views" for creating common bits of UI that get reused across multiple pages

Resources