Solved

View markup in MVC 4

Posted on 2013-01-10
2
189 Views
Last Modified: 2013-01-14
In my view, I noticed that their are two different ways to start of my view form.

Here is the first one :  
@using (Html.BeginForm() )
{

}


Or you can just use :
@{



}


Are these two basically equivalent, or is one better than the other?
0
Comment
Question by:brgdotnet
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 23

Accepted Solution

by:
Roopesh Reddy earned 100 total points
ID: 38766024
Hi,

The first one renders the controls inside the  <form>! Basically if you require FORM tag to be rendered, you will use that! It's an HTML Helper for <form> tag!


The Second one is general, to render the general Server Side Code!

More info on Razor - http://www.asp.net/web-pages/overview/more-resources/asp-net-web-pages-api-reference

Hope it helps u...
0
 
LVL 2

Author Closing Comment

by:brgdotnet
ID: 38776895
Thanks. Been traveling. Sorry about the delay. Have a great week!
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

I have developed many web applications with asp & asp.net and to add and use a dropdownlist was always a very simple task, but with the new asp.net, setting the value is a bit tricky and its not similar to the old traditional method. So in this a…
A quick way to get a menu to work on our website, is using the Menu control and assign it to a web.sitemap using SiteMapDataSource. Example of web.sitemap file: (CODE) Sample code to add to the page menu: (CODE) Running the application, we wi…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …
Suggested Courses

737 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question